Beispiel #1
0
 /**
  * @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());
 }
Beispiel #2
0
 /**
  * @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());
 }