本文整理汇总了PHP中Tests\Framework\TestResources类的典型用法代码示例。如果您正苦于以下问题:PHP TestResources类的具体用法?PHP TestResources怎么用?PHP TestResources使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestResources类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$serviceBusWrapper = $this->builder->createServiceBusService(TestResources::getServiceBusConnectionString());
$this->_createdTopics = array();
$this->_createdSubscriptions = array();
$this->_createdRules = array();
$this->_createdQueues = array();
parent::setProxy($serviceBusWrapper);
}
示例2: testSetValue
/**
* @covers WindowsAzure\Common\Models\GetServicePropertiesResult::setValue
*/
public function testSetValue()
{
// Setup
$result = new GetServicePropertiesResult();
$expected = ServiceProperties::create(TestResources::getServicePropertiesSample());
// Test
$result->setValue($expected);
// Assert
$this->assertEquals($expected, $result->getValue());
}
示例3: setUpBeforeClass
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');
}
}
示例4: __construct
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();
}
示例5: testWrapAccessToken
/**
* @covers WindowsAzure\ServiceBus\Internal\WrapRestProxy::__construct
* @covers WindowsAzure\ServiceBus\Internal\WrapRestProxy::wrapAccessToken
*/
public function testWrapAccessToken()
{
$settings = ServiceBusSettings::createFromConnectionString(TestResources::getServiceBusConnectionString());
$wrapUri = $settings->getWrapEndpointUri();
$wrapUserName = $settings->getWrapName();
$wrapPassword = $settings->getWrapPassword();
$scope = str_replace('https', 'http', $settings->getServiceBusEndpointUri());
$wrapAccessTokenResult = $this->_wrapRestProxy->wrapAccessToken($wrapUri, $wrapUserName, $wrapPassword, $scope);
$this->assertNotNull($wrapAccessTokenResult);
$this->assertNotNull($wrapAccessTokenResult->getAccessToken());
}
示例6: __construct
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();
}
示例7: testSerialize
/**
* @covers WindowsAzure\Common\Internal\Serialization\XmlSerializer::serialize
* @covers WindowsAzure\Common\Internal\Serialization\XmlSerializer::_arr2xml
*/
public function testSerialize()
{
// Setup
$xmlSerializer = new XmlSerializer();
$propertiesSample = TestResources::getServicePropertiesSample();
$properties = ServiceProperties::create($propertiesSample);
$expected = $properties->toXml($xmlSerializer);
$array = $properties->toArray();
$serializerProperties = array(XmlSerializer::ROOT_NAME => ServiceProperties::$xmlRootName);
// Test
$actual = $xmlSerializer->serialize($array, $serializerProperties);
$this->assertEquals($expected, $actual);
}
示例8: testCreateWithConfig
/**
* @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);
}
示例9: __construct
public function __construct()
{
$config = new Configuration();
$config->setProperty(ServiceManagementSettings::SUBSCRIPTION_ID, TestResources::serviceManagementSubscriptionId());
$config->setProperty(ServiceManagementSettings::URI, Resources::SERVICE_MANAGEMENT_URL);
$config->setProperty(ServiceManagementSettings::CERTIFICATE_PATH, TestResources::serviceManagementCertificatePath());
$serviceManagementRestProxy = ServiceManagementService::create($config);
parent::__construct($config, $serviceManagementRestProxy);
$this->createdStorageServices = array();
$this->createdAffinityGroups = array();
$this->storageCount = count($this->restProxy->listStorageServices()->getStorageServices());
$this->affinityGroupCount = count($this->restProxy->listAffinityGroups()->getAffinityGroups());
}
示例10: testCreateFromPeekMessages
/**
* @covers WindowsAzure\Queue\Models\WindowsAzureQueueMessage::createFromPeekMessages
*/
public function testCreateFromPeekMessages()
{
// Setup
$sample = TestResources::listMessagesSample();
$sample = $sample['QueueMessage'];
// Test
$actual = WindowsAzureQueueMessage::createFromPeekMessages($sample);
// Assert
$this->assertEquals($sample['MessageId'], $actual->getMessageId());
$this->assertEquals(Utilities::rfc1123ToDateTime($sample['InsertionTime']), $actual->getInsertionDate());
$this->assertEquals(Utilities::rfc1123ToDateTime($sample['ExpirationTime']), $actual->getExpirationDate());
$this->assertEquals(intval($sample['DequeueCount']), $actual->getDequeueCount());
$this->assertEquals($sample['MessageText'], $actual->getMessageText());
}
示例11: testCreate
/**
* @covers WindowsAzure\Blob\Models\CreateBlobPagesResult::create
*/
public function testCreate()
{
// Setup
$sample = TestResources::listBlobsOneEntry();
$expected = $sample['Blobs']['Blob']['Properties'];
$expectedDate = Utilities::rfc1123ToDateTime($expected['Last-Modified']);
// Test
$actual = CreateBlobPagesResult::create($expected);
// Assert
$this->assertEquals($expectedDate, $actual->getLastModified());
$this->assertEquals($expected['Etag'], $actual->getETag());
$this->assertEquals($expected['Content-MD5'], $actual->getContentMD5());
$this->assertEquals(intval($expected['x-ms-blob-sequence-number']), $actual->getSequenceNumber());
}
示例12: testCreateWithMultipleEntries
/**
* @covers WindowsAzure\Blob\Models\ListBlobsResult::create
*/
public function testCreateWithMultipleEntries()
{
// Setup
$sample = TestResources::listBlobsMultipleEntries();
// Test
$actual = ListBlobsResult::create($sample);
// Assert
$this->assertCount(2, $actual->getBlobs());
$this->assertCount(2, $actual->getBlobPrefixes());
$this->assertEquals($sample['Marker'], $actual->getMarker());
$this->assertEquals(intval($sample['MaxResults']), $actual->getMaxResults());
$this->assertEquals($sample['NextMarker'], $actual->getNextMarker());
return $actual;
}
示例13: testHandleResponse
/**
* @covers WindowsAzure\Common\Internal\Filters\WrapFilter::handleResponse
*/
public function testHandleResponse()
{
// Setup
$channel = new HttpClient();
$url = new Url('http://microsoft.com');
$channel->setUrl($url);
$response = null;
$settings = ServiceBusSettings::createFromConnectionString(TestResources::getServiceBusConnectionString());
$wrapUri = $settings->getWrapEndpointUri();
$wrapFilter = new WrapFilter($wrapUri, $settings->getWrapName(), $settings->getWrapPassword(), $this->_wrapRestProxy);
// Test
$response = $wrapFilter->handleResponse($channel, $response);
// Assert
$this->assertNull($response);
}
示例14: testGetAccessToken
/**
* @covers WindowsAzure\Common\Internal\OAuthRestProxy::getAccessToken
* @covers WindowsAzure\Common\Internal\OAuthRestProxy::__construct
*/
public function testGetAccessToken()
{
// Setup
$channel = new HttpClient();
$uri = Resources::MEDIA_SERVICES_OAUTH_URL;
$connection = TestResources::getMediaServicesConnectionParameters();
$settings = new MediaServicesSettings($connection['accountName'], $connection['accessKey']);
$scope = Resources::MEDIA_SERVICES_OAUTH_SCOPE;
// Test
$proxy = new OAuthRestProxy($channel, $uri);
$actual = $proxy->getAccessToken(Resources::OAUTH_GT_CLIENT_CREDENTIALS, $settings->getAccountName(), $settings->getAccessKey(), $scope);
// Assert
$this->assertNotNull($proxy);
$this->assertNotNull($actual->getAccessToken());
$this->assertGreaterThan(time(), $actual->getExpiresIn());
$this->assertEquals($scope, $actual->getScope());
}
示例15: testCreateWithMultipleEntries
/**
* @covers WindowsAzure\Queue\Models\ListQueuesResult::create
*/
public function testCreateWithMultipleEntries()
{
// Setup
$sample = TestResources::listQueuesMultipleEntries();
// Test
$actual = ListQueuesResult::create($sample);
// Assert
$queues = $actual->getQueues();
$this->assertCount(2, $queues);
$this->assertEquals($sample['Queues']['Queue'][0]['Name'], $queues[0]->getName());
$this->assertEquals($sample['Queues']['Queue'][0]['Url'], $queues[0]->getUrl());
$this->assertEquals($sample['Queues']['Queue'][1]['Name'], $queues[1]->getName());
$this->assertEquals($sample['Queues']['Queue'][1]['Url'], $queues[1]->getUrl());
$this->assertEquals($sample['MaxResults'], $actual->getMaxResults());
$this->assertEquals($sample['NextMarker'], $actual->getNextMarker());
return $actual;
}