[BUGFIX] Failing test in autoloader with phpunit 3.6
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 12 Apr 2012 14:25:10 +0000 (16:25 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 12 Apr 2012 14:27:49 +0000 (16:27 +0200)
The next phpunit extension will deliver phpunit 3.6. Some autoloader
unit tests fail with this version because of unclean tests. The patch
cleans that up to make the tests run with both phpunit 3.5 and 3.6.

Change-Id: Ib8cae2dfab5d9d638d481aa91b129f44fb0eaa01
Resolves: #35905
Releases: 6.0, 4.7, 4.6
Reviewed-on: http://review.typo3.org/10341
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
tests/t3lib/class.t3lib_autoloaderTest.php

index b5773fd..475630f 100644 (file)
@@ -125,7 +125,7 @@ class t3lib_autoloaderTest extends Tx_Phpunit_TestCase {
                $mockCache = $this->getMock('t3lib_cache_frontend_AbstractFrontend', array('getIdentifier', 'set', 'get', 'getByTag', 'has', 'remove', 'flush', 'flushByTag', 'requireOnce'), array(), '', FALSE);
                        // Expect the mock cache set method to be called
                        // once with t3lib_autoloader as third parameter
-               $mockCache->expects($this->once())->method('set')->with(TRUE, TRUE, array('t3lib_autoloader'));
+               $mockCache->expects($this->once())->method('set')->with($this->anything(), $this->anything(), array('t3lib_autoloader'));
                $GLOBALS['typo3CacheManager'] = $this->getMock('t3lib_cache_Manager', array('getCache'));
                $GLOBALS['typo3CacheManager']->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
                t3lib_autoloader::unregisterAutoloader();
@@ -209,7 +209,7 @@ class t3lib_autoloaderTest extends Tx_Phpunit_TestCase {
                $GLOBALS['typo3CacheManager']->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
 
                        // Expect that an entry to the cache is written containing the newly found class
-               $mockCache->expects($this->once())->method('set')->with(TRUE, $this->stringContains(strtolower($class), TRUE));
+               $mockCache->expects($this->once())->method('set')->with($this->anything(), $this->stringContains(strtolower($class), $this->anything()));
 
                t3lib_autoloader::autoload($class);
        }
@@ -234,7 +234,7 @@ class t3lib_autoloaderTest extends Tx_Phpunit_TestCase {
                $GLOBALS['typo3CacheManager']->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
 
                        // Expect that an entry to the cache is written containing the newly found class
-               $mockCache->expects($this->once())->method('set')->with(TRUE, $this->stringContains(strtolower($file), TRUE));
+               $mockCache->expects($this->once())->method('set')->with($this->anything(), $this->stringContains(strtolower($file), $this->anything()));
 
                t3lib_autoloader::autoload($class);
        }