當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Framework\TestResources類代碼示例

本文整理匯總了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);
 }
開發者ID:bitmovin,項目名稱:azure-sdk-for-php,代碼行數:10,代碼來源:ServiceBusRestProxyTestBase.php

示例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());
 }
開發者ID:southworkscom,項目名稱:azure-sdk-for-php,代碼行數:13,代碼來源:GetServicePropertiesResultTest.php

示例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');
     }
 }
開發者ID:rdohms,項目名稱:azure-sdk-for-php,代碼行數:11,代碼來源:ServiceRestProxyTestBase.php

示例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();
 }
開發者ID:rdohms,項目名稱:azure-sdk-for-php,代碼行數:11,代碼來源:BlobServiceRestProxyTestBase.php

示例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());
 }
開發者ID:bitmovin,項目名稱:azure-sdk-for-php,代碼行數:15,代碼來源:WrapRestProxyTest.php

示例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();
 }
開發者ID:rdohms,項目名稱:azure-sdk-for-php,代碼行數:11,代碼來源:QueueServiceRestProxyTestBase.php

示例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);
 }
開發者ID:southworkscom,項目名稱:azure-sdk-for-php,代碼行數:17,代碼來源:XmlSerializerTest.php

示例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);
 }
開發者ID:rdohms,項目名稱:azure-sdk-for-php,代碼行數:16,代碼來源:TableServiceTest.php

示例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());
 }
開發者ID:rdohms,項目名稱:azure-sdk-for-php,代碼行數:13,代碼來源:ServiceManagementRestProxyTestBase.php

示例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());
 }
開發者ID:bitmovin,項目名稱:azure-sdk-for-php,代碼行數:17,代碼來源:WindowsAzureQueueMessageTest.php

示例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());
 }
開發者ID:bitmovin,項目名稱:azure-sdk-for-php,代碼行數:17,代碼來源:CreateBlobPagesResultTest.php

示例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;
 }
開發者ID:rdohms,項目名稱:azure-sdk-for-php,代碼行數:17,代碼來源:ListBlobsResultTest.php

示例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);
 }
開發者ID:jdruid,項目名稱:Microsoft-Azure-PHP-SDK-Storage,代碼行數:18,代碼來源:WrapFilterTest.php

示例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());
 }
開發者ID:jdruid,項目名稱:Microsoft-Azure-PHP-SDK-Storage,代碼行數:21,代碼來源:OAuthRestProxyTest.php

示例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;
 }
開發者ID:bitmovin,項目名稱:azure-sdk-for-php,代碼行數:20,代碼來源:ListQueuesResultTest.php


注:本文中的Tests\Framework\TestResources類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。