Ejemplo n.º 1
0
 /**
  * Sets up this test case
  *
  * @return void
  */
 public function setUp()
 {
     $this->_amazon = new SimpleDb\SimpleDb(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY'));
     $this->_httpClientAdapterSocket = new Socket();
     $this->_amazon->getHttpClient()->setAdapter($this->_httpClientAdapterSocket);
     $this->_testDomainNamePrefix = 'TestsZendServiceAmazonSimpleDbDomain';
     $this->_testItemNamePrefix = 'TestsZendServiceAmazonSimpleDbItem';
     $this->_testAttributeNamePrefix = 'TestsZendServiceAmazonSimpleDbAttribute';
     $this->_wait();
 }
Ejemplo n.º 2
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 SimpleDb\SimpleDb(constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_ACCESSKEYID'), constant('TESTS_ZEND_SERVICE_AMAZON_ONLINE_SECRETKEY'));
     $this->_httpClientAdapterSocket = new Socket();
     $this->_amazon->getHttpClient()->setAdapter($this->_httpClientAdapterSocket);
     $this->_testDomainNamePrefix = 'TestsZendServiceAmazonSimpleDbDomain';
     $this->_testItemNamePrefix = 'TestsZendServiceAmazonSimpleDbItem';
     $this->_testAttributeNamePrefix = 'TestsZendServiceAmazonSimpleDbAttribute';
     $this->_wait();
 }
Ejemplo n.º 3
0
 /**
  * Query for documents stored in the document service. If a string is passed in
  * $query, the query string will be passed directly to the service.
  *
  * @param  string $collectionName Collection name
  * @param  string $query
  * @param  array $options
  * @return array Zend\Cloud\DocumentService\DocumentSet
  */
 public function query($collectionName, $query, $options = null)
 {
     $returnDocs = isset($options[self::RETURN_DOCUMENTS]) ? (bool) $options[self::RETURN_DOCUMENTS] : true;
     try {
         if ($query instanceof Zend\Cloud\DocumentService\Adapter\SimpleDb\Query) {
             $query = $query->assemble($collectionName);
         }
         $result = $this->_simpleDb->select($query);
     } catch (Zend\Service\Amazon\Exception $e) {
         throw new Exception\RuntimeException('Error on document query: ' . $e->getMessage(), $e->getCode(), $e);
     }
     return $this->_getDocumentSetFromResultSet($result, $returnDocs);
 }
Ejemplo n.º 4
0
 public function testDeleteDomain()
 {
     $domainName = $this->_testDomainNamePrefix . '_testDeleteDomain';
     $this->_amazon->deleteDomain($domainName);
     $this->_amazon->createDomain($domainName);
     try {
         $domainListPage = $this->_amazon->listDomains();
         $this->assertContains($domainName, $domainListPage->getData());
         $this->assertNull($domainListPage->getToken());
         // Delete the domain
         $this->_amazon->deleteDomain($domainName);
         $domainListPage = $this->_amazon->listDomains();
         $this->assertNotContains($domainName, $domainListPage->getData());
     } catch (Exception $e) {
         $this->_amazon->deleteDomain($domainName);
         throw $e;
     }
 }