Project

General

Profile

Bug #25090 ยป typo3-17657-unit_test_assertType.diff

Administrator Admin, 2011-02-18 18:05

View differences:

tests/t3lib/cache/t3lib_cache_factoryTest.php (Arbeitskopie)
$factory->setCacheManager($mockCacheManager);
$cache = $factory->create('TYPO3_Cache_FactoryTest_Cache', 't3lib_cache_frontend_VariableFrontend', 't3lib_cache_backend_NullBackend');
$this->assertType('t3lib_cache_frontend_VariableFrontend', $cache);
$this->assertInstanceOf('t3lib_cache_frontend_VariableFrontend', $cache);
}
/**
tests/t3lib/t3lib_divTest.php (Arbeitskopie)
$path = PATH_t3lib;
$directories = t3lib_div::get_dirs($path);
$this->assertType('array', $directories);
$this->assertInternalType('array', $directories);
}
/**
......
rmdir($directory);
$this->assertTrue($directoryCreated);
$this->assertType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $fileInfo);
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $fileInfo);
$this->assertEquals($directoryPath, $fileInfo['path']);
$this->assertEquals($directoryName, $fileInfo['file']);
$this->assertEquals($directoryName, $fileInfo['filebody']);
......
$testFile = 'fileadmin/media/someFile.png';
$fileInfo = t3lib_div::split_fileref($testFile);
$this->assertType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $fileInfo);
$this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $fileInfo);
$this->assertEquals('fileadmin/media/', $fileInfo['path']);
$this->assertEquals('someFile.png', $fileInfo['file']);
$this->assertEquals('someFile', $fileInfo['filebody']);
    (1-1/1)