I am developing a PHP-powered application component which exports some data to an XML file which must follow a scheme defined by XSD file. I know how to validate the file manually, but it would be very handy if this could be done within unit tests.
Is there any library or framework available which can me help doing that?
One possibility would be to use DOMDocument::schemaValidate
or DOMDocument::schemaValidateSource
. Since either of those two methods returns a boolean value, you could then assert that the returned value is true
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With