/** * @visible for testing. * @param Postman_Google_Http_Request $request * @return Postman_Google_Http_Request|bool Returns the cached object or * false if the operation was unsuccessful. */ public function getCachedRequest(Postman_Google_Http_Request $request) { if (false === Postman_Google_Http_CacheParser::isRequestCacheable($request)) { return false; } return $this->client->getCache()->get($request->getCacheKey()); }
/** * @requires extension Memcached */ public function testAppEngineAutoConfig() { $_SERVER['SERVER_SOFTWARE'] = 'Google App Engine'; $client = new Postman_Google_Client(); $this->assertInstanceOf('Postman_Google_Cache_Memcache', $client->getCache()); $this->assertInstanceOf('Postman_Google_Io_Stream', $client->getIo()); unset($_SERVER['SERVER_SOFTWARE']); }