/** * @test */ public function removeCallsBackend() { $cacheIdentifier = 'someCacheIdentifier'; $backend = $this->getMockBuilder(\TYPO3\Flow\Cache\Backend\AbstractBackend::class)->disableOriginalConstructor()->setMethods(array('get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'))->getMock(); $backend->expects($this->once())->method('remove')->with($this->equalTo($cacheIdentifier))->will($this->returnValue(true)); $cache = new \TYPO3\Flow\Cache\Frontend\StringFrontend('StringFrontend', $backend); $this->assertTrue($cache->remove($cacheIdentifier), 'remove() did not return TRUE'); }
/** * @test */ public function removeCallsBackend() { $cacheIdentifier = 'someCacheIdentifier'; $backend = $this->getMock('TYPO3\\Flow\\Cache\\Backend\\AbstractBackend', array('get', 'set', 'has', 'remove', 'findIdentifiersByTag', 'flush', 'flushByTag', 'collectGarbage'), array(), '', FALSE); $backend->expects($this->once())->method('remove')->with($this->equalTo($cacheIdentifier))->will($this->returnValue(TRUE)); $cache = new \TYPO3\Flow\Cache\Frontend\StringFrontend('StringFrontend', $backend); $this->assertTrue($cache->remove($cacheIdentifier), 'remove() did not return TRUE'); }