Ejemplo n.º 1
0
 /**
  * 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());
 }
Ejemplo n.º 2
0
 /**
  * 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;
 }
Ejemplo n.º 3
0
 /**
  * @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);
 }
Ejemplo n.º 4
0
 /**
  * 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);
 }
Ejemplo n.º 5
0
 /**
  * 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;
 }
Ejemplo n.º 6
0
 /**
  * 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());
 }
Ejemplo n.º 8
0
 /**
  * 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);
 }
Ejemplo n.º 9
0
 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);
 }