public function __construct() { $config = new Configuration(); $queueUri = TestResources::accountName() . '.queue.core.windows.net'; $config->setProperty(QueueSettings::ACCOUNT_KEY, TestResources::accountKey()); $config->setProperty(QueueSettings::ACCOUNT_NAME, TestResources::accountName()); $config->setProperty(QueueSettings::URI, $queueUri); $queueRestProxy = QueueService::create($config); parent::__construct($config, $queueRestProxy); $this->_createdQueues = array(); }
public function __construct() { $config = new Configuration(); $blobUri = 'http://' . TestResources::accountName() . '.blob.core.windows.net'; $config->setProperty(BlobSettings::ACCOUNT_KEY, TestResources::accountKey()); $config->setProperty(BlobSettings::ACCOUNT_NAME, TestResources::accountName()); $config->setProperty(BlobSettings::URI, $blobUri); $blobRestProxy = BlobService::create($config); parent::__construct($config, $blobRestProxy); $this->_createdContainers = array(); }
public static function setUpBeforeClass() { $storageKey = TestResources::accountKey(); $storageName = TestResources::accountName(); if (empty($storageKey)) { throw new \Exception('AZURE_STORAGE_KEY envionment variable is missing'); } if (empty($storageName)) { throw new \Exception('AZURE_STORAGE_ACCOUNT envionment variable is missing'); } }
/** * @covers WindowsAzure\Table\TableService::create */ public function testCreateWithConfig() { // Setup $uri = 'http://' . TestResources::accountName() . '.table.core.windows.net'; $config = new Configuration(); $config->setProperty(TableSettings::ACCOUNT_KEY, TestResources::accountKey()); $config->setProperty(TableSettings::ACCOUNT_NAME, TestResources::accountName()); $config->setProperty(TableSettings::URI, $uri); // Test $tableRestProxy = TableService::create($config); // Assert $this->assertInstanceOf('WindowsAzure\\Table\\Internal\\ITable', $tableRestProxy); }
/** * @covers WindowsAzure\Common\Internal\ServicesBuilder::build * @covers WindowsAzure\Common\Internal\ServicesBuilder::_validateConfig */ public function testBuildWithInvalidTypeFail() { // Setup $uri = 'http://' . TestResources::accountName() . '.queue.core.windows.net'; $config = new Configuration(); $config->setProperty(QueueSettings::ACCOUNT_KEY, TestResources::accountKey()); $config->setProperty(QueueSettings::ACCOUNT_NAME, TestResources::accountName()); $config->setProperty(QueueSettings::URI, $uri); $builder = new ServicesBuilder(); $this->setExpectedException(get_class(new InvalidArgumentTypeException(''))); // Test $builder->build($config, 'FooType'); }