/** * @param bool $isActionCacheable * @param bool $requestIsCached * @param bool $expectedUseCacheHash * @test * @dataProvider uriForDisablesCacheHashIfPossibleDataProvider */ public function uriForDisablesCacheHashIfPossible($isActionCacheable, $requestIsCached, $expectedUseCacheHash) { $this->mockExtensionService->expects($this->once())->method('isActionCacheable')->will($this->returnValue($isActionCacheable)); $this->mockRequest->expects($this->once())->method('isCached')->will($this->returnValue($requestIsCached)); $this->uriBuilder->uriFor('someNonCacheableAction', array(), 'SomeController', 'SomeExtension'); $this->assertEquals($expectedUseCacheHash, $this->uriBuilder->getUseCacheHash()); }
/** * @test */ public function uriForDoesNotDisableCacheHashForNonCacheableActions() { $this->mockExtensionService->expects($this->any())->method('isActionCacheable')->will($this->returnValue(false)); $this->uriBuilder->uriFor('someNonCacheableAction', array(), 'SomeController', 'SomeExtension'); $this->assertTrue($this->uriBuilder->getUseCacheHash()); }