public function testReturnsRequestcanCacheRequest() { $strategy = new DefaultCanCacheStrategy(); $response = $this->getMockBuilder('Guzzle\\Http\\Message\\Request')->disableOriginalConstructor()->setMethods(array('canCache'))->getMock(); $response->expects($this->once())->method('canCache')->will($this->returnValue(true)); $this->assertTrue($strategy->canCacheRequest($response)); }
public function canCacheRequest(RequestInterface $request) { return $this->requestCallback ? call_user_func($this->requestCallback, $request) : parent::canCacheRequest($request); }
public function testDoesNotCacheNoStore() { $strategy = new DefaultCanCacheStrategy(); $request = new Request('GET', 'http://foo.com', array('cache-control' => 'no-store')); $this->assertFalse($strategy->canCacheRequest($request)); }