/** * @test */ public function setCachedValueForRequestTest() { $response = new \Bullet\Response(); $response->content('Test content'); $uri = 'MyAliasedModel'; $request = $this->buildRequestWithUri($uri); $this->fixture->setCachedValueForRequest($request, $response); $cachedResponse = $this->fixture->getCachedValueForRequest($request); $this->assertInstanceOf('Bullet\\Response', $cachedResponse); $this->assertEquals('Test content', $cachedResponse); }
/** * @test */ public function setCachedValueForRequestTest() { $response = new \Bullet\Response(); $response->content('Test content'); $uri = 'MyAliasedModel'; $request = $this->buildRequestWithUri($uri); /** @var \TYPO3\CMS\Core\Cache\Frontend\VariableFrontend|\PHPUnit_Framework_MockObject_MockObject $cacheInstance */ $cacheInstance = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Frontend\\AbstractFrontend', array('getIdentifier', 'set', 'get', 'getByTag', 'has', 'remove', 'flush', 'flushByTag'), array(), '', FALSE); $cacheInstance->expects($this->atLeastOnce())->method('set')->will($this->returnValue('')); $this->fixture->setCacheInstance($cacheInstance); $this->fixture->setCachedValueForRequest($request, $response); }