Esempio n. 1
0
 /**
  * @covers WindowsAzure\ServiceManagement\Models\Service::serialize
  * @covers WindowsAzure\ServiceManagement\Models\Service::__construct
  * @covers WindowsAzure\ServiceManagement\Models\Service::toArray
  */
 public function testSerialize()
 {
     // Setup
     $serializer = new XmlSerializer();
     $expected = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
     $expected .= '<CreateService xmlns="http://schemas.microsoft.com/windowsazure">' . "\n";
     $expected .= ' <Label>Label</Label>' . "\n";
     $expected .= ' <Description>Description</Description>' . "\n";
     $expected .= ' <Location>Location</Location>' . "\n";
     $expected .= '</CreateService>' . "\n";
     $service = new Service();
     $service->setName('Name');
     $service->setLabel('Label');
     $service->setLocation('Location');
     $service->setDescription('Description');
     $service->addSerializationProperty(XmlSerializer::ROOT_NAME, 'CreateService');
     // Test
     $actual = $service->serialize($serializer);
     // Assert
     $this->assertEquals($expected, $actual);
 }