diff --git a/src/TestUtils/SchemaValidationTestTrait.php b/src/TestUtils/SchemaValidationTestTrait.php index f2894b8..5537d0f 100644 --- a/src/TestUtils/SchemaValidationTestTrait.php +++ b/src/TestUtils/SchemaValidationTestTrait.php @@ -16,6 +16,9 @@ */ trait SchemaValidationTestTrait { + /** @var string|null */ + protected static ?string $schemaFile = null; + /** @var class-string */ protected static string $testedClass; @@ -41,14 +44,14 @@ public function testSchemaValidation(): void ); } else { // Validate before serialization - self::$testedClass::schemaValidate(self::$xmlRepresentation); + self::$testedClass::schemaValidate(self::$xmlRepresentation, self::$schemaFile); // Perform serialization $class = self::$testedClass::fromXML(self::$xmlRepresentation->documentElement); $serializedClass = $class->toXML(); // Validate after serialization - self::$testedClass::schemaValidate($serializedClass->ownerDocument); + self::$testedClass::schemaValidate($serializedClass->ownerDocument, self::$schemaFile); // If we got this far and no exceptions were thrown, consider this test passed! $this->addToAssertionCount(1);