/**
  * @test
  */
 public function canRoundTripConvert()
 {
     $product = new Product();
     $fixture = $this->getFixtureContent('Api/Client/System/XMLContentMapper/Fixture/product.xml');
     $this->mapper->fromXML($product, $fixture);
     $color = $product->getAttributeByName('color');
     $this->assertEquals(1, count($color->getValues()), 'Reconstituted product with unexpected amount of attributes');
     $xmlOut = $this->mapper->toXML($product);
     $cleanFixture = $this->getDOMParserXMLOutput($fixture);
     $cleanXml = $this->getDOMParserXMLOutput($xmlOut);
     $this->assertEquals($cleanFixture, $cleanXml);
 }
Ejemplo n.º 2
0
 /**
  * @return string
  */
 public function getContent()
 {
     return $this->xmlMapper->toXML($this);
 }