public function setUp()
 {
     //$this->markTestSkipped('No offline tests for Zend_Service_Amazon_Sqs');
     $this->_amazon = new Zend_Service_Amazon_Sqs('test', 'test');
     $this->_httpClientAdapterTest = new Zend_Http_Client_Adapter_Test();
     $this->_amazon->getHttpClient()->setAdapter($this->_httpClientAdapterTest);
 }
 /**
  * Sets up this test case
  *
  * @return void
  */
 public function setUp()
 {
     $this->_amazon = new Zend_Service_Amazon_Sqs(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY'));
     $this->_queue_name = constant('TESTS_ZEND_SERVICE_AMAZON_SQS_QUEUE');
     $this->_httpClientAdapterSocket = new Zend_Http_Client_Adapter_Socket();
     $this->_amazon->getHttpClient()->setAdapter($this->_httpClientAdapterSocket);
 }
Exemple #3
0
 /**
  * Sets up this test case
  *
  * @return void
  */
 public function setUp()
 {
     if (!constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ENABLED')) {
         $this->markTestSkipped('Zend_Service_Amazon online tests are not enabled');
     }
     $this->_amazon = new \Zend\Service\Amazon\Sqs\Sqs(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY'));
     $this->_queue_name = constant('TESTS_ZEND_SERVICE_AMAZON_SQS_QUEUE');
     $this->_httpClientAdapterSocket = new \Zend\Http\Client\Adapter\Socket();
     $this->_amazon->getHttpClient()->setAdapter($this->_httpClientAdapterSocket);
 }
 /**
  * Constructor
  *
  * @param  array|Zend_Config $options
  * @return void
  */
 public function __construct($options = array())
 {
     if ($options instanceof Zend_Config) {
         $options = $options->toArray();
     }
     if (!is_array($options)) {
         throw new Zend_Cloud_QueueService_Exception('Invalid options provided');
     }
     if (isset($options[self::MESSAGE_CLASS])) {
         $this->setMessageClass($options[self::MESSAGE_CLASS]);
     }
     if (isset($options[self::MESSAGESET_CLASS])) {
         $this->setMessageSetClass($options[self::MESSAGESET_CLASS]);
     }
     try {
         $this->_sqs = new Zend_Service_Amazon_Sqs($options[self::AWS_ACCESS_KEY], $options[self::AWS_SECRET_KEY]);
     } catch (Zend_Service_Amazon_Exception $e) {
         throw new Zend_Cloud_QueueService_Exception('Error on create: ' . $e->getMessage(), $e->getCode(), $e);
     }
     if (isset($options[self::HTTP_ADAPTER])) {
         $this->_sqs->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]);
     }
 }