[BUGFIX] Replace deprecated assertType in unit tests
authorAlexander Stehlik <alexander.stehlik@googlemail.com>
Thu, 21 Apr 2011 13:01:33 +0000 (15:01 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 21 Apr 2011 13:10:21 +0000 (15:10 +0200)
Change-Id: I8fd91f031634e43a34ab1d3b75869452a8dd4d6a
Resolves: #25090
Releases: 4.6, 4.5
Reviewed-on: http://review.typo3.org/1696
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
tests/t3lib/cache/class.t3lib_cache_factoryTest.php
tests/t3lib/class.t3lib_divTest.php
typo3/sysext/scheduler/tests/tx_scheduler_croncmdTest.php
typo3/sysext/scheduler/tests/tx_scheduler_croncmd_normalizeTest.php

index 1cbb249..282cb98 100644 (file)
@@ -60,7 +60,7 @@ class t3lib_cache_FactoryTest extends tx_phpunit_testcase {
                $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);
        }
 
        /**
index c2f91ca..e5003b6 100644 (file)
@@ -1293,7 +1293,7 @@ class t3lib_divTest extends tx_phpunit_testcase {
                $path = PATH_t3lib;
                $directories = t3lib_div::get_dirs($path);
 
-               $this->assertType('array', $directories);
+               $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $directories);
        }
 
        /**
@@ -2117,7 +2117,7 @@ class t3lib_divTest extends tx_phpunit_testcase {
                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']);
@@ -2132,7 +2132,7 @@ class t3lib_divTest extends tx_phpunit_testcase {
                $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']);
index a43dcb1..99553b9 100644 (file)
@@ -254,7 +254,7 @@ class tx_scheduler_croncmdTest extends tx_phpunit_testcase {
         */
        public function getTimestampReturnsInteger() {
                $instance = new tx_scheduler_CronCmd('* * * * *');
-               $this->assertType('integer', $instance->getTimestamp());
+               $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $instance->getTimestamp());
        }
 
        /**
@@ -262,7 +262,7 @@ class tx_scheduler_croncmdTest extends tx_phpunit_testcase {
         */
        public function getCronCommandSectionsReturnsArray() {
                $instance = new tx_scheduler_CronCmd('* * * * *');
-               $this->assertType('array', $instance->getCronCommandSections());
+               $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_ARRAY, $instance->getCronCommandSections());
        }
 }
 ?>
\ No newline at end of file
index b975d6d..f22bb54 100644 (file)
@@ -439,7 +439,7 @@ class tx_scheduler_CronCmd_NormalizeTest extends tx_phpunit_testcase {
         */
        public function normalizeMonthReturnsInteger($monthName, $expectedInteger) {
                $result = tx_scheduler_CronCmd_Normalize::normalizeMonth($monthName);
-               $this->assertType('integer', $result);
+               $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $result);
        }
 
        /**
@@ -527,7 +527,7 @@ class tx_scheduler_CronCmd_NormalizeTest extends tx_phpunit_testcase {
         */
        public function normalizeWeekdayReturnsInteger($weekday, $expectedInteger) {
                $result = tx_scheduler_CronCmd_Normalize::normalizeWeekday($weekday);
-               $this->assertType('integer', $result);
+               $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_INT, $result);
        }
 
        /**