/**
  * Sets up this test case
  *
  * @return void
  */
 public function setUp()
 {
     if (!constant('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_ENABLED')) {
         $this->markTestSkipped('Rackspace online tests are not enabled');
     }
     parent::setUp();
     $this->_waitPeriod = 5;
     // Create the container here
     $rackspace = new Zend_Service_Rackspace_Files($this->_config->get(Zend_Cloud_StorageService_Adapter_Rackspace::USER), $this->_config->get(Zend_Cloud_StorageService_Adapter_Rackspace::API_KEY));
     $rackspace->createContainer($this->_config->get(Zend_Cloud_StorageService_Adapter_Rackspace::REMOTE_CONTAINER));
 }
Beispiel #2
0
 /**
  * Create a new container if it doesn't exists.
  *
  * @return string
  */
 public function getCurrentClientContainer()
 {
     if (empty($this->_clientId)) {
         return false;
     }
     $container = strtolower(APPLICATION_ENV) . '-client-' . $this->_clientId;
     if (!$this->_service->getContainer($container)) {
         $this->_service->createContainer($container);
         $this->_service->enableCdnContainer($container);
         if (!$this->_service->isSuccessful()) {
             throw new Exception($this->_service->getErrorMsg());
         }
     }
     return $container;
 }
Beispiel #3
0
 public function testCreateContainer()
 {
     $container = $this->rackspace->createContainer(TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME, $this->metadata);
     $this->assertTrue($container !== false);
     $this->assertEquals($container->getName(), TESTS_ZEND_SERVICE_RACKSPACE_CONTAINER_NAME);
 }
 public function testCreateContainer()
 {
     $container = $this->rackspace->createContainer('zf-unit-test', $this->metadata);
     $this->assertTrue($container !== false);
     $this->assertEquals($container->getName(), 'zf-unit-test');
 }