diff --git a/typo3/sysext/core/Tests/Unit/Cache/Backend/ApcBackendTest.php b/typo3/sysext/core/Tests/Unit/Cache/Backend/ApcBackendTest.php index 1dc21226ac23680ba9d3a98df18f2281119e6c11..e13736ed6ad883d994f672a2b9993fad284a06e7 100644 --- a/typo3/sysext/core/Tests/Unit/Cache/Backend/ApcBackendTest.php +++ b/typo3/sysext/core/Tests/Unit/Cache/Backend/ApcBackendTest.php @@ -15,6 +15,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend; */ use TYPO3\CMS\Core\Cache\Backend\ApcBackend; +use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; /** * Testcase for the APC cache backend. @@ -135,36 +136,6 @@ class ApcBackendTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase $this->assertEquals([], $retrieved, 'Found entry which should no longer exist.'); } - /** - * @test - */ - public function setCacheIsSettingIdentifierPrefixWithCacheIdentifier() - { - /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cacheMock */ - $cacheMock = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::class); - $cacheMock->expects($this->any())->method('getIdentifier')->will($this->returnValue( - 'testidentifier' - )); - - /** @var $backendMock \PHPUnit_Framework_MockObject_MockObject|ApcBackend */ - $backendMock = $this->getMockBuilder(ApcBackend::class) - ->setMethods(['setIdentifierPrefix', 'getCurrentUserData', 'getPathSite']) - ->setConstructorArgs(['testcontext']) - ->getMock(); - - $backendMock->expects($this->once())->method('getCurrentUserData')->will( - $this->returnValue(['name' => 'testname']) - ); - - $backendMock->expects($this->once())->method('getPathSite')->will( - $this->returnValue('testpath') - ); - - $expectedIdentifier = 'TYPO3_' . \TYPO3\CMS\Core\Utility\GeneralUtility::shortMD5('testpath' . 'testname' . 'testcontext' . 'testidentifier', 12); - $backendMock->expects($this->once())->method('setIdentifierPrefix')->with($expectedIdentifier); - $backendMock->setCache($cacheMock); - } - /** * @test */ @@ -240,14 +211,14 @@ class ApcBackendTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase */ public function flushRemovesOnlyOwnEntries() { - /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $thisCache */ - $thisCache = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::class); + /** @var \PHPUnit_Framework_MockObject_MockObject|FrontendInterface $thisCache */ + $thisCache = $this->createMock(FrontendInterface::class); $thisCache->expects($this->any())->method('getIdentifier')->will($this->returnValue('thisCache')); $thisBackend = new ApcBackend('Testing'); $thisBackend->setCache($thisCache); - /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $thatCache */ - $thatCache = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::class); + /** @var \PHPUnit_Framework_MockObject_MockObject|FrontendInterface $thatCache */ + $thatCache = $this->createMock(FrontendInterface::class); $thatCache->expects($this->any())->method('getIdentifier')->will($this->returnValue('thatCache')); $thatBackend = new ApcBackend('Testing'); $thatBackend->setCache($thatCache); @@ -303,8 +274,8 @@ class ApcBackendTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase */ protected function setUpBackend($accessible = false) { - /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache */ - $cache = $this->createMock(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface::class); + /** @var \PHPUnit_Framework_MockObject_MockObject|FrontendInterface $cache */ + $cache = $this->createMock(FrontendInterface::class); if ($accessible) { $accessibleClassName = $this->buildAccessibleProxy(ApcBackend::class); $backend = new $accessibleClassName('Testing'); diff --git a/typo3/sysext/core/Tests/Unit/Cache/Backend/ApcuBackendTest.php b/typo3/sysext/core/Tests/Unit/Cache/Backend/ApcuBackendTest.php index bf9b55b2a5bd749d540bbd73fb4125193bf147c9..6a7610bef7fe119e2e4b12cc74a0f14c023e6a1e 100644 --- a/typo3/sysext/core/Tests/Unit/Cache/Backend/ApcuBackendTest.php +++ b/typo3/sysext/core/Tests/Unit/Cache/Backend/ApcuBackendTest.php @@ -17,7 +17,6 @@ namespace TYPO3\CMS\Core\Tests\Unit\Cache\Backend; use TYPO3\CMS\Core\Cache\Backend\ApcuBackend; use TYPO3\CMS\Core\Cache\Exception; use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface; -use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\TestingFramework\Core\AccessibleObjectInterface; /** @@ -137,36 +136,6 @@ class ApcuBackendTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase $this->assertEquals([], $retrieved); } - /** - * @test - */ - public function setCacheIsSettingIdentifierPrefixWithCacheIdentifier() - { - /** @var \PHPUnit_Framework_MockObject_MockObject|FrontendInterface $cacheMock */ - $cacheMock = $this->createMock(FrontendInterface::class); - $cacheMock->expects($this->any())->method('getIdentifier')->will($this->returnValue( - 'testidentifier' - )); - - /** @var $backendMock \PHPUnit_Framework_MockObject_MockObject|ApcuBackend */ - $backendMock = $this->getMockBuilder(ApcuBackend::class) - ->setMethods(['setIdentifierPrefix', 'getCurrentUserData', 'getPathSite']) - ->setConstructorArgs(['testcontext']) - ->getMock(); - - $backendMock->expects($this->once())->method('getCurrentUserData')->will( - $this->returnValue(['name' => 'testname']) - ); - - $backendMock->expects($this->once())->method('getPathSite')->will( - $this->returnValue('testpath') - ); - - $expectedIdentifier = 'TYPO3_' . GeneralUtility::shortMD5('testpath' . 'testname' . 'testcontext' . 'testidentifier', 12); - $backendMock->expects($this->once())->method('setIdentifierPrefix')->with($expectedIdentifier); - $backendMock->setCache($cacheMock); - } - /** * @test */