Exemplo n.º 1
0
 /**
  * @covers Guzzle\Http\Plugin\CachePlugin::getCacheKey
  */
 public function testCreatesEncodedKeys()
 {
     $plugin = new CachePlugin($this->adapter);
     $request = RequestFactory::getInstance()->fromMessage("GET / HTTP/1.1\r\nHost: www.test.com\r\nCache-Control: no-cache, no-store, max-age=120");
     $key = $plugin->getCacheKey($request);
     $this->assertEquals(1, preg_match('/^gz_[a-z0-9]{32}$/', $key));
     // Make sure that the same value is returned in a subsequent call
     $this->assertEquals($key, $plugin->getCacheKey($request));
 }