View Issue Details

IDProjectCategoryView StatusLast Update
0004665OXID eShop (all versions)4.07. Source code, Testpublic2012-11-19 15:41
ReporterHelmut L. Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Product Version4.6.5 revision 49955 
Summary0004665: Type Hints for oxConfig fail in unit tests
DescriptionIf I use a type hint for oxConfig in a method and pass an oxConfig Object to it wich I get using the oxConfig::getInstance Method these calls fail in Unit Test because the getInstance Method returns then an modConfig Object wich is no child class of the oxConfig object.
Steps To Reproducecreate a test class and use it in a unit test:
class test {
    public function test() {
        $config = oxConfig::getInstance();
        $this->typeHint($config);
    }

    public function typeHint(oxConfig $config) {
    }
}
TagsNo tags attached.
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Activities

Linas Kukulskis

2012-11-19 15:41

reporter   ~0007903

in 5.0 it works

in 4.6 use: mock or create oxConfig with new

 public function test() {
        $config = new oxConfig();
or
        $config = $this->getMock( 'oxConfig', array( 'some methods' ), array(), '', false );
        $this->typeHint($config);
    }