コード例 #1
0
 /**
  * @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);
 }
コード例 #2
0
 /**
  * @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());
 }
コード例 #3
0
 /**
  * @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);
 }