/** * Sets up this test case * * @return void */ public function setUp() { if (!constant('TESTS_ZEND_SERVICE_FLICKR_ONLINE_ENABLED')) { $this->markTestSkipped('Zend_Service_Flickr online tests are not enabled'); } $this->_flickr = new Zend_Service_Flickr(constant('TESTS_ZEND_SERVICE_FLICKR_ONLINE_APIKEY')); $this->_httpClientAdapterSocket = new Zend_Http_Client_Adapter_Socket(); $this->_flickr->getRestClient()->getHttpClient()->setAdapter($this->_httpClientAdapterSocket); }
/** * Sets up this test case * * @return void */ public function setUp() { /** * @see Zend_Service_Flickr */ // require_once 'Zend/Service/Flickr.php'; $this->_flickr = new Zend_Service_Flickr(constant('TESTS_ZEND_SERVICE_FLICKR_ONLINE_APIKEY')); /** * @see Zend_Http_Client_Adapter_Socket */ // require_once 'Zend/Http/Client/Adapter/Socket.php'; $this->_httpClientAdapterSocket = new Zend_Http_Client_Adapter_Socket(); $this->_flickr->getRestClient()->getHttpClient()->setAdapter($this->_httpClientAdapterSocket); }
/** * Utility method that saves an HTTP response to a file * * @param string $name * @return void */ protected function _saveResponse($name) { file_put_contents("{$this->_filesPath}/{$name}.response", $this->_flickr->getRestClient()->getHttpClient()->getLastResponse()->asString()); }