Пример #1
0
 /**
  * @test
  */
 public function shouldRenewCacheWhenResourceHasChanged()
 {
     $cache = $this->getCacheMock();
     $response = new Response(200);
     $client = $this->getBrowserMock();
     $client->expects($this->once())->method('send')->will($this->returnValue($response));
     $httpClient = new CachedHttpClient(array('base_url' => ''), $client);
     $httpClient->setCache($cache);
     $cache->expects($this->once())->method('set')->with('test', $response);
     $cache->expects($this->once())->method('getModifiedSince')->with('test')->will($this->returnValue(1256953732));
     $httpClient->get('test');
 }