Skip to content

Commit 4bf0ac7

Browse files
committed
schema validate after normalization
1 parent 64e4d31 commit 4bf0ac7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/XML/TestUtils/SchemaValidationTestTrait.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use DOMDocument;
88
use PHPUnit\Framework\Attributes\Depends;
9+
use SimpleSAML\XML\DOMDocumentFactory;
910

1011
use function class_exists;
1112

@@ -54,6 +55,12 @@ public function testSchemaValidation(): void
5455
// Validate after serialization
5556
self::$testedClass::schemaValidate($serializedClass->ownerDocument, self::$schemaFile);
5657

58+
// Validate after normalization
59+
if (self::$testedClass::getNormalization() === true) {
60+
$normalizedDoc = DOMDocumentFactory::normalizeDocument($serializedClass->ownerDocument);
61+
self::$testedClass::schemaValidate($normalizedDoc, self::$schemaFile);
62+
}
63+
5764
// If we got this far and no exceptions were thrown, consider this test passed!
5865
$this->addToAssertionCount(1);
5966
}

0 commit comments

Comments
 (0)