/** * reset zend service http client * * @return void */ public function setUp() { if (!defined('TESTS_ZEND_SERVICE_SHORTURL_BITLY_ENABLED') || !constant('TESTS_ZEND_SERVICE_SHORTURL_BITLY_ENABLED')) { $this->markTestSkipped('Testing Zend_Service_ShortUrl_BitLyTest only works when TESTS_ZEND_SERVICE_SHORTURL_BITLY_ENABLED is set.'); } Zend_Service_Abstract::setHttpClient(new Zend_Http_Client()); }
/** * Gets the HTTP client object. * * @return Zend_Http_Client_Abstract */ public static final function getHttpClient() { if (!self::$_httpClient instanceof Zend_Http_Client_Abstract) { self::$_httpClient = new Zend_Http_Client(); } return self::$_httpClient; }
/** * @issue ZF-8218 */ public function testUserNameNotRequired() { Zend_Service_Abstract::getHttpClient()->setAdapter('Zend_Http_Client_Adapter_Socket'); $twitter = new Zend_Service_Twitter(); $exists = $twitter->user->show('zftestuser1')->id() !== null; $this->assertTrue($exists); unset($twitter); }
/** * Creates a new Zend_Service_ShortUrl_IsGd object for each test method * * @return void */ public function setUp() { if (!defined('TESTS_ZEND_SERVICE_SHORTURL_ISGD_ENABLED') || !constant('TESTS_ZEND_SERVICE_SHORTURL_ISGD_ENABLED')) { $this->markTestSkipped('Testing Zend_Service_ShortUrl_IsGdTest only works when TESTS_ZEND_SERVICE_SHORTURL_ISGD_ENABLED is set.'); } Zend_Service_Abstract::setHttpClient(new Zend_Http_Client()); $this->_s = new Zend_Service_ShortUrl_IsGd(); $this->_s->getHttpClient()->resetParameters(true); }
/** * Sets authentication options * * @param array $config */ public function setConfig(array $config) { //if( empty($config['username']) || // empty($config['password']) ) { // throw new Engine_Payment_Gateway_Exception('Missing username or password'); //} $this->_config = $config; if ($this->_service && method_exists($this->_service, 'setOptions')) { $this->_service->setOptions($this->_config); } return $this; }
/** * Creates a new Zend_Service_JdemCz object for each test method * * @return void */ public function setUp() { Zend_Service_Abstract::setHttpClient(new Zend_Http_Client()); $this->_s = new Zend_Service_ShortUrl_JdemCz(); }
public function teardown() { Zend_Service_Abstract::setHttpClient(new Zend_Http_Client()); }
/** * Creates a new Zend_Service_ShortUrl_IsGd object for each test method * * @return void */ public function setUp() { Zend_Service_Abstract::setHttpClient(new Zend_Http_Client()); $this->_s = new Zend_Service_ShortUrl_IsGd(); $this->_s->getHttpClient()->resetParameters(true); }
public function setUp() { $this->_adapter = new Zend_Http_Client_Adapter_Test(); $client = new Zend_Http_Client(null, array('adapter' => $this->_adapter)); Zend_Service_Abstract::setHttpClient($client); }