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