Skip to content

Commit b93a3de

Browse files
committed
use assertXmlStringEqualsXmlString to compare xml strings
1 parent 2d35606 commit b93a3de

54 files changed

Lines changed: 271 additions & 217 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/XMLSchema/XML/AllTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,11 @@ public function testMarshalling(): void
223223
[self::$testContainer->getXMLAttribute(3)],
224224
);
225225

226-
$this->assertEquals(
227-
self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement),
228-
strval($all),
229-
);
226+
$expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement);
227+
$this->assertNotFalse($expectedXml);
228+
$actualXml = strval($all);
229+
230+
$this->assertXmlStringEqualsXmlString($expectedXml, $actualXml);
230231

231232
$this->assertFalse($all->isEmptyElement());
232233
}

tests/XMLSchema/XML/AnnotationTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ public function testMarshalling(): void
8888
[self::$testContainer->getXMLAttribute(3)],
8989
);
9090

91-
$this->assertEquals(
92-
self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement),
93-
strval($annotation),
94-
);
91+
$expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement);
92+
$this->assertNotFalse($expectedXml);
93+
$actualXml = strval($annotation);
94+
95+
$this->assertXmlStringEqualsXmlString($expectedXml, $actualXml);
9596

9697
$this->assertFalse($annotation->isEmptyElement());
9798
}

tests/XMLSchema/XML/AnyAttributeTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ public function testMarshalling(): void
104104
[self::$testContainer->getXMLAttribute(4)],
105105
);
106106

107-
$this->assertEquals(
108-
self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement),
109-
strval($anyAttribute),
110-
);
107+
$expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement);
108+
$this->assertNotFalse($expectedXml);
109+
$actualXml = strval($anyAttribute);
110+
111+
$this->assertXmlStringEqualsXmlString($expectedXml, $actualXml);
111112
}
112113
}

tests/XMLSchema/XML/AnyTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ public function testMarshalling(): void
109109
MaxOccursValue::fromString('unbounded'),
110110
);
111111

112-
$this->assertEquals(
113-
self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement),
114-
strval($any),
115-
);
112+
$expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement);
113+
$this->assertNotFalse($expectedXml);
114+
$actualXml = strval($any);
115+
116+
$this->assertXmlStringEqualsXmlString($expectedXml, $actualXml);
116117
}
117118

118119

tests/XMLSchema/XML/AppinfoTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ public function testMarshalling(): void
5656
{
5757
$appinfo = self::$testContainer->getAppinfo(1);
5858

59-
$this->assertEquals(
60-
self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement),
61-
strval($appinfo),
62-
);
59+
$expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement);
60+
$this->assertNotFalse($expectedXml);
61+
$actualXml = strval($appinfo);
62+
63+
$this->assertXmlStringEqualsXmlString($expectedXml, $actualXml);
6364

6465
$this->assertFalse($appinfo->isEmptyElement());
6566
}

tests/XMLSchema/XML/ChoiceTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,11 @@ public function testMarshalling(): void
109109
[self::$testContainer->getXMLAttribute(4)],
110110
);
111111

112-
$this->assertEquals(
113-
self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement),
114-
strval($choice),
115-
);
112+
$expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement);
113+
$this->assertNotFalse($expectedXml);
114+
$actualXml = strval($choice);
115+
116+
$this->assertXmlStringEqualsXmlString($expectedXml, $actualXml);
116117
}
117118

118119

tests/XMLSchema/XML/ComplexContentTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,11 @@ public function testMarshalling(): void
142142
[self::$testContainer->getXMLAttribute(4)],
143143
);
144144

145-
$this->assertEquals(
146-
self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement),
147-
strval($complexContent),
148-
);
145+
$expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement);
146+
$this->assertNotFalse($expectedXml);
147+
$actualXml = strval($complexContent);
148+
149+
$this->assertXmlStringEqualsXmlString($expectedXml, $actualXml);
149150

150151
$this->assertFalse($complexContent->isEmptyElement());
151152
}

tests/XMLSchema/XML/ComplexRestrictionTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@ public function testMarshalling(): void
134134
[self::$testContainer->getXMLAttribute(4)],
135135
);
136136

137-
$this->assertEquals(
138-
self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement),
139-
strval($complexRestriction),
140-
);
137+
$expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement);
138+
$this->assertNotFalse($expectedXml);
139+
$actualXml = strval($complexRestriction);
140+
141+
$this->assertXmlStringEqualsXmlString($expectedXml, $actualXml);
141142
}
142143
}

tests/XMLSchema/XML/DocumentationTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ public function testMarshalling(): void
6666
[self::$testContainer->getXMLAttribute(1)],
6767
);
6868

69-
$this->assertEquals(
70-
self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement),
71-
strval($documentation),
72-
);
69+
$expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement);
70+
$this->assertNotFalse($expectedXml);
71+
$actualXml = strval($documentation);
72+
73+
$this->assertXmlStringEqualsXmlString($expectedXml, $actualXml);
7374

7475
$this->assertFalse($documentation->isEmptyElement());
7576
}

tests/XMLSchema/XML/EnumerationTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ public function testMarshalling(): void
100100
[self::$testContainer->getXMLAttribute(4)],
101101
);
102102

103-
$this->assertEquals(
104-
self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement),
105-
strval($enumeration),
106-
);
103+
$expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement);
104+
$this->assertNotFalse($expectedXml);
105+
$actualXml = strval($enumeration);
106+
107+
$this->assertXmlStringEqualsXmlString($expectedXml, $actualXml);
107108
}
108109
}

0 commit comments

Comments
 (0)