File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 16
16
*/
17
17
trait SchemaValidationTestTrait
18
18
{
19
+ /** @var string|null */
20
+ protected static ?string $ schemaFile = null ;
21
+
19
22
/** @var class-string */
20
23
protected static string $ testedClass ;
21
24
@@ -41,14 +44,14 @@ public function testSchemaValidation(): void
41
44
);
42
45
} else {
43
46
// Validate before serialization
44
- self ::$ testedClass ::schemaValidate (self ::$ xmlRepresentation );
47
+ self ::$ testedClass ::schemaValidate (self ::$ xmlRepresentation, self :: $ schemaFile );
45
48
46
49
// Perform serialization
47
50
$ class = self ::$ testedClass ::fromXML (self ::$ xmlRepresentation ->documentElement );
48
51
$ serializedClass = $ class ->toXML ();
49
52
50
53
// Validate after serialization
51
- self ::$ testedClass ::schemaValidate ($ serializedClass ->ownerDocument );
54
+ self ::$ testedClass ::schemaValidate ($ serializedClass ->ownerDocument , self :: $ schemaFile );
52
55
53
56
// If we got this far and no exceptions were thrown, consider this test passed!
54
57
$ this ->addToAssertionCount (1 );
You can’t perform that action at this time.
0 commit comments