当前位置: 首页>>代码示例>>PHP>>正文


PHP TestResources::getServicePropertiesSample方法代码示例

本文整理汇总了PHP中Tests\Framework\TestResources::getServicePropertiesSample方法的典型用法代码示例。如果您正苦于以下问题:PHP TestResources::getServicePropertiesSample方法的具体用法?PHP TestResources::getServicePropertiesSample怎么用?PHP TestResources::getServicePropertiesSample使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tests\Framework\TestResources的用法示例。


在下文中一共展示了TestResources::getServicePropertiesSample方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

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

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

示例3: testToArrayWithoutDays

 /**
  * @covers WindowsAzure\Common\Models\RetentionPolicy::toArray
  */
 public function testToArrayWithoutDays()
 {
     // Setup
     $sample = TestResources::getServicePropertiesSample();
     $retentionPolicy = RetentionPolicy::create($sample['Logging']['RetentionPolicy']);
     $expected = array('Enabled' => $sample['Logging']['RetentionPolicy']['Enabled']);
     $retentionPolicy->setDays(null);
     // Test
     $actual = $retentionPolicy->toArray();
     // Assert
     $this->assertEquals($expected, $actual);
 }
开发者ID:jdruid,项目名称:Microsoft-Azure-PHP-SDK-Storage,代码行数:15,代码来源:RetentionPolicyTest.php

示例4: testSerialize

 /**
  * @covers WindowsAzure\Common\Internal\Utilities::serialize
  * @covers WindowsAzure\Common\Internal\Utilities::_arr2xml
  */
 public function testSerialize()
 {
     // Setup
     $propertiesSample = TestResources::getServicePropertiesSample();
     $properties = ServiceProperties::create($propertiesSample);
     $expected = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
     $expected .= '<StorageServiceProperties><Logging><Version>1.0</Version><Delete>true</Delete>';
     $expected .= '<Read>false</Read><Write>true</Write><RetentionPolicy><Enabled>true</Enabled>';
     $expected .= '<Days>20</Days></RetentionPolicy></Logging><Metrics><Version>1.0</Version>';
     $expected .= '<Enabled>true</Enabled><IncludeAPIs>false</IncludeAPIs><RetentionPolicy>';
     $expected .= '<Enabled>true</Enabled><Days>20</Days></RetentionPolicy></Metrics></StorageServiceProperties>';
     $array = $properties->toArray();
     // Test
     $actual = Utilities::serialize($array, ServiceProperties::$xmlRootName);
     $this->assertEquals($expected, $actual);
 }
开发者ID:southworkscom,项目名称:azure-sdk-for-php,代码行数:20,代码来源:UtilitiesTest.php

示例5: testToArrayWithNotEnabled

 /**
  * @covers WindowsAzure\Common\Models\Metrics::toArray
  */
 public function testToArrayWithNotEnabled()
 {
     // Setup
     $sample = TestResources::getServicePropertiesSample();
     $sample['Metrics']['Enabled'] = 'false';
     $metrics = Metrics::create($sample['Metrics']);
     $expected = array('Version' => $sample['Metrics']['Version'], 'Enabled' => $sample['Metrics']['Enabled'], 'RetentionPolicy' => $metrics->getRetentionPolicy()->toArray());
     // Test
     $actual = $metrics->toArray();
     // Assert
     $this->assertEquals($expected, $actual);
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:15,代码来源:MetricsTest.php

示例6: testToArray

 /**
  * @covers WindowsAzure\Common\Models\Logging::toArray
  */
 public function testToArray()
 {
     // Setup
     $sample = TestResources::getServicePropertiesSample();
     $logging = Logging::create($sample['Logging']);
     $expected = array('Version' => $sample['Logging']['Version'], 'Delete' => $sample['Logging']['Delete'], 'Read' => $sample['Logging']['Read'], 'Write' => $sample['Logging']['Write'], 'RetentionPolicy' => $logging->getRetentionPolicy()->toArray());
     // Test
     $actual = $logging->toArray();
     // Assert
     $this->assertEquals($expected, $actual);
 }
开发者ID:rdohms,项目名称:azure-sdk-for-php,代码行数:14,代码来源:LoggingTest.php

示例7: testToXml

 /**
  * @covers WindowsAzure\Common\Models\ServiceProperties::toXml
  */
 public function testToXml()
 {
     // Setup
     $properties = ServiceProperties::create(TestResources::getServicePropertiesSample());
     $xmlSerializer = new XmlSerializer();
     // Test
     $actual = $properties->toXml($xmlSerializer);
     // Assert
     $actualParsed = Utilities::unserialize($actual);
     $actualProperties = GetServicePropertiesResult::create($actualParsed);
     $this->assertEquals($actualProperties->getValue(), $properties);
 }
开发者ID:bitmovin,项目名称:azure-sdk-for-php,代码行数:15,代码来源:ServicePropertiesTest.php


注:本文中的Tests\Framework\TestResources::getServicePropertiesSample方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。