@@ -29,10 +29,11 @@ public function testMarshalling(): void
2929 /** @var \SimpleSAML\WebServices\SecurityPolicy\XML\sp_200702\AbstractNestedPolicyType $np */
3030 $ np = new static::$ testedClass ([static ::$ chunk ], [static ::$ attr ]);
3131
32- $ this ->assertEquals (
33- static ::$ xmlRepresentation ->saveXML (static ::$ xmlRepresentation ->documentElement ),
34- strval ($ np ),
35- );
32+ $ expectedXml = static ::$ xmlRepresentation ->saveXml (static ::$ xmlRepresentation ->documentElement );
33+ $ this ->assertNotFalse ($ expectedXml );
34+ $ actualXml = strval ($ np );
35+
36+ $ this ->assertXmlStringEqualsXmlString ($ expectedXml , $ actualXml );
3637 }
3738
3839
@@ -55,10 +56,11 @@ public function testMarshallingWithoutNSAttr(): void
5556 /** @var \SimpleSAML\WebServices\SecurityPolicy\XML\sp_200702\AbstractNestedPolicyType $np */
5657 $ np = new static::$ testedClass ([static ::$ chunk ]);
5758
58- $ this ->assertEquals (
59- $ xmlRepresentation ->saveXML ($ xmlRepresentation ->documentElement ),
60- strval ($ np ),
61- );
59+ $ expectedXml = $ xmlRepresentation ->saveXml ($ xmlRepresentation ->documentElement );
60+ $ this ->assertNotFalse ($ expectedXml );
61+ $ actualXml = strval ($ np );
62+
63+ $ this ->assertXmlStringEqualsXmlString ($ expectedXml , $ actualXml );
6264 }
6365
6466
@@ -75,12 +77,13 @@ public function testMarshallingWithoutChildren(): void
7577 $ xmlRepresentation = DOMDocumentFactory::fromString ($ xml );
7678
7779 /** @var \SimpleSAML\WebServices\SecurityPolicy\XML\sp_200702\AbstractNestedPolicyType $qns */
78- $ qns = new static::$ testedClass ([], [static ::$ attr ]);
80+ $ np = new static::$ testedClass ([], [static ::$ attr ]);
7981
80- $ this ->assertEquals (
81- $ xmlRepresentation ->saveXML ($ xmlRepresentation ->documentElement ),
82- strval ($ qns ),
83- );
82+ $ expectedXml = $ xmlRepresentation ->saveXml ($ xmlRepresentation ->documentElement );
83+ $ this ->assertNotFalse ($ expectedXml );
84+ $ actualXml = strval ($ np );
85+
86+ $ this ->assertXmlStringEqualsXmlString ($ expectedXml , $ actualXml );
8487 }
8588
8689
@@ -127,10 +130,11 @@ public function testUnmarshallingWithoutNSAttr(): void
127130 /** @var \SimpleSAML\WebServices\SecurityPolicy\XML\sp_200702\AbstractNestedPolicyType $np */
128131 $ np = static ::$ testedClass ::fromXML ($ xmlRepresentation ->documentElement );
129132
130- $ this ->assertEquals (
131- $ xmlRepresentation ->saveXML ($ xmlRepresentation ->documentElement ),
132- strval ($ np ),
133- );
133+ $ expectedXml = $ xmlRepresentation ->saveXml ($ xmlRepresentation ->documentElement );
134+ $ this ->assertNotFalse ($ expectedXml );
135+ $ actualXml = strval ($ np );
136+
137+ $ this ->assertXmlStringEqualsXmlString ($ expectedXml , $ actualXml );
134138 }
135139
136140
@@ -150,9 +154,10 @@ public function testUnmarshallingWithoutChildren(): void
150154 /** @var \SimpleSAML\WebServices\SecurityPolicy\XML\sp_200702\AbstractNestedPolicyType $np */
151155 $ np = static ::$ testedClass ::fromXML ($ xmlRepresentation ->documentElement );
152156
153- $ this ->assertEquals (
154- $ xmlRepresentation ->saveXML ($ xmlRepresentation ->documentElement ),
155- strval ($ np ),
156- );
157+ $ expectedXml = $ xmlRepresentation ->saveXml ($ xmlRepresentation ->documentElement );
158+ $ this ->assertNotFalse ($ expectedXml );
159+ $ actualXml = strval ($ np );
160+
161+ $ this ->assertXmlStringEqualsXmlString ($ expectedXml , $ actualXml );
157162 }
158163}
0 commit comments