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


PHP TestResources::getMediaServicesConnectionParameters方法代碼示例

本文整理匯總了PHP中Tests\Framework\TestResources::getMediaServicesConnectionParameters方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestResources::getMediaServicesConnectionParameters方法的具體用法?PHP TestResources::getMediaServicesConnectionParameters怎麽用?PHP TestResources::getMediaServicesConnectionParameters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tests\Framework\TestResources的用法示例。


在下文中一共展示了TestResources::getMediaServicesConnectionParameters方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $connection = TestResources::getMediaServicesConnectionParameters();
     $settings = new MediaServicesSettings($connection['accountName'], $connection['accessKey'], $connection['endpointUri'], $connection['oauthEndopointUri']);
     $mediaServicesWrapper = $this->builder->createMediaServicesService($settings);
     parent::setProxy($mediaServicesWrapper);
 }
開發者ID:jdruid,項目名稱:Microsoft-Azure-PHP-SDK-Storage,代碼行數:8,代碼來源:MediaServicesRestProxyTestBase.php

示例2: 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

示例3: testGetIngestManifestStorageAccount

 /**
  * @covers WindowsAzure\MediaServices\MediaServicesRestProxy::getIngestManifestStorageAccount
  */
 public function testGetIngestManifestStorageAccount()
 {
     // Setup
     $ingestManifest = new IngestManifest();
     $name = TestResources::MEDIA_SERVICES_INGEST_MANIFEST . $this->createSuffix();
     $ingestManifest->setName($name);
     $ingestManifest = $this->createIngestManifest($ingestManifest);
     $connectionParameters = TestResources::getMediaServicesConnectionParameters();
     $storageAccountName = $connectionParameters['accountName'];
     // Test
     $result = $this->restProxy->getIngestManifestStorageAccount($ingestManifest);
     // Assert
     $this->assertEquals($ingestManifest->getStorageAccountName(), $result->getName());
 }
開發者ID:southworkscom,項目名稱:azure-sdk-for-php,代碼行數:17,代碼來源:MediaServicesRestProxyTest.php

示例4: testGetAssetStorageAccount

 /**
  * @covers WindowsAzure\MediaServices\MediaServicesRestProxy::getAssetStorageAccount
  */
 public function testGetAssetStorageAccount()
 {
     // Setup
     $asset = new Asset(Asset::OPTIONS_NONE);
     $asset->setName(TestResources::MEDIA_SERVICES_ASSET_NAME . $this->createSuffix());
     $asset = $this->createAsset($asset);
     $connectionParameters = TestResources::getMediaServicesConnectionParameters();
     $storageAccountName = $connectionParameters['accountName'];
     // Test
     $result = $this->restProxy->getAssetStorageAccount($asset);
     // Assert
     $this->assertEquals($storageAccountName, $result->getName());
 }
開發者ID:jdruid,項目名稱:Microsoft-Azure-PHP-SDK-Storage,代碼行數:16,代碼來源:MediaServicesRestProxyTest.php

示例5: testBuildForMediaServices

 /**
  * @covers WindowsAzure\Common\ServicesBuilder::createMediaServicesService
  */
 public function testBuildForMediaServices()
 {
     // Setup
     $builder = new ServicesBuilder();
     $connection = TestResources::getMediaServicesConnectionParameters();
     $settings = new MediaServicesSettings($connection['accountName'], $connection['accessKey']);
     // Test
     $mediaServicesRestProxy = $builder->createMediaServicesService($settings);
     // Assert
     $this->assertInstanceOf('WindowsAzure\\MediaServices\\Internal\\IMediaServices', $mediaServicesRestProxy);
 }
開發者ID:bitmovin,項目名稱:azure-sdk-for-php,代碼行數:14,代碼來源:ServicesBuilderTest.php

示例6: testGetAuthorizationHeaderMultiple

 /**
  * @covers WindowsAzure\Common\Internal\Authentication\OAuthScheme::getAuthorizationHeader
  */
 public function testGetAuthorizationHeaderMultiple()
 {
     $this->skipIfEmulated();
     // Setup
     // OAuth REST 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;
     $grantType = Resources::OAUTH_GT_CLIENT_CREDENTIALS;
     $rest = new OAuthRestProxy($channel, $uri);
     // Scheme setup
     $headers = array();
     $url = Resources::MEDIA_SERVICES_URL;
     $queryParams = array();
     $httpMethod = Resources::HTTP_GET;
     // Get access token
     $scheme = new OAuthScheme($settings->getAccountName(), $settings->getAccessKey(), $grantType, $scope, $rest);
     $token = $scheme->getAuthorizationHeader($headers, $url, $queryParams, $httpMethod);
     // Test
     $actual = $scheme->getAuthorizationHeader($headers, $url, $queryParams, $httpMethod);
     // Assert
     $this->assertEquals($token, $actual);
 }
開發者ID:southworkscom,項目名稱:azure-sdk-for-php,代碼行數:28,代碼來源:OAuthSchemeTest.php


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