/** * Creates ServiceProperties object from parsed XML response. * * @param array $parsedResponse XML response parsed into array. * * @return MicrosoftAzure\Storage\Common\Models\ServiceProperties. */ public static function create($parsedResponse) { $result = new ServiceProperties(); $result->setLogging(Logging::create($parsedResponse['Logging'])); $result->setMetrics(Metrics::create($parsedResponse['HourMetrics'])); return $result; }
/** * @covers MicrosoftAzure\Storage\Common\Models\ServiceProperties::getLogging */ public function testGetLogging() { // Setup $sample = TestResources::getServicePropertiesSample(); $logging = Logging::create($sample['Logging']); $result = new ServiceProperties(); $result->setLogging($logging); // Test $actual = $result->getLogging($logging); // Assert $this->assertEquals($logging, $actual); }
/** * @covers MicrosoftAzure\Storage\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); }