当前位置: 首页>>代码示例>>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;未经允许,请勿转载。