本文整理汇总了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);
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}