/** * @covers MicrosoftAzure\Storage\Common\Internal\Utilities::unserialize * @covers MicrosoftAzure\Storage\Common\Internal\Utilities::_sxml2arr */ public function testUnserialize() { // Setup $propertiesSample = TestResources::getServicePropertiesSample(); $properties = ServiceProperties::create($propertiesSample); $xmlSerializer = new XmlSerializer(); $xml = $properties->toXml($xmlSerializer); $expected = $properties->toArray(); // Test $actual = Utilities::unserialize($xml); $this->assertEquals($expected, $actual); }
/** * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::toXml * @covers MicrosoftAzure\Storage\Blob\Models\ContainerAcl::toArray * @depends testCreateMultipleEntries */ public function testToXml($acl) { // Setup $sample = TestResources::getContainerAclMultipleEntriesSample(); $expected = ContainerAcl::create('container', $sample['SignedIdentifiers']); $xmlSerializer = new XmlSerializer(); // Test $xml = $acl->toXml($xmlSerializer); // Assert $array = Utilities::unserialize($xml); $acl = ContainerAcl::create('container', $array); $this->assertEquals($expected->getSignedIdentifiers(), $acl->getSignedIdentifiers()); }
/** * @covers MicrosoftAzure\Storage\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); }