/** * SetUpBerofeClass */ public static function setUpBeforeClass() { if (!constant('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_ENABLED')) { self::markTestSkipped('Zend\Service\Rackspace\TFiles online tests are not enabled'); } if(!defined('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_USER') || !defined('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_KEY')) { self::markTestSkipped('Constants User and Key have to be set.'); } self::$rackspace = new RackspaceFiles(TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_USER, TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_KEY); self::$httpClientAdapterSocket = new \Zend\Http\Client\Adapter\Socket(); self::$rackspace->getHttpClient() ->setAdapter(self::$httpClientAdapterSocket); self::$metadata = array ( 'foo' => 'bar', 'foo2' => 'bar2' ); self::$metadata2 = array ( 'hello' => 'world' ); }
/** * Set up the test case * * @return void */ public function setUp() { if (!constant('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_ENABLED') || TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_ENABLED != true) { $this->markTestSkipped('Zend\\Service\\Rackspace\\TFiles online tests are not enabled'); } if (!defined('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_USER') || !defined('TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_KEY')) { $this->markTestSkipped('Constants User and Key have to be set.'); } $this->rackspace = new RackspaceFiles(TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_USER, TESTS_ZEND_SERVICE_RACKSPACE_ONLINE_KEY); $this->httpClientAdapterSocket = new \Zend\Http\Client\Adapter\Socket(); $this->rackspace->getHttpClient()->setAdapter($this->httpClientAdapterSocket); $this->metadata = array('foo' => 'bar', 'foo2' => 'bar2'); $this->metadata2 = array('hello' => 'world'); // terms of use compliance: safe delay between each test sleep(1); }