@@ -41,9 +41,20 @@ final class OrderRequestTest extends TestCase implements PayloadIdentityFactoryI
4141{
4242 private DtdValidator $ dtdValidator ;
4343
44+ private Serializer $ serializer ;
45+
4446 protected function setUp (): void
4547 {
4648 $ this ->dtdValidator = DtdValidator::fromDtdDirectory (__DIR__ . '/../../metadata/cxml/dtd/1.2.050/ ' );
49+ $ this ->serializer = Serializer::create ();
50+ }
51+
52+ public function testReference (): void
53+ {
54+ // test whether deserialize/serialize of the reference file works
55+ $ xml = file_get_contents (__DIR__ . '/../../metadata/cxml/samples/OrderRequest.xml ' );
56+ $ cxml = Serializer::create ()->deserialize ($ xml );
57+ Serializer::create ()->serialize ($ cxml );
4758 }
4859
4960 public function testMinimumExample (): void
@@ -171,6 +182,8 @@ public function testMinimumExample(): void
171182 ),
172183 new DateTime ('2020-02-28 ' ),
173184 );
185+ $ item ->addComment (new Comment ('Test comment ' , 'test ' , '' ));
186+
174187 $ orderRequest ->addItem ($ item );
175188
176189 $ cxml = Builder::create ('Platform Order Fulfillment Hub ' , null , $ this )
@@ -183,7 +196,7 @@ public function testMinimumExample(): void
183196 $ this ->assertSame ('OrderRequest_1625586002.193314.7293@dev ' , (string )$ cxml );
184197
185198 $ xml = Serializer::create ()->serialize ($ cxml );
186- $ this ->assertXmlStringEqualsXmlFile (' tests /metadata/cxml/samples/OrderRequest.xml ' , $ xml );
199+ $ this ->assertXmlStringEqualsXmlFile (__DIR__ . ' /../.. /metadata/cxml/samples/OrderRequest.xml ' , $ xml );
187200
188201 $ this ->dtdValidator ->validateAgainstDtd ($ xml );
189202 }
0 commit comments