Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds XSD schema validation testing to ensure that serialized XML output conforms to the expected schema definition.
Changes:
- Added a new test method
testSchemaIsValid()that validates serialized XML against an XSD schema - Moved
ext-domand addedext-libxmlfrom production dependencies to development dependencies
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/Serializer/SerializerTest.php | Added XSD validation test and helper method to format validation errors |
| composer.json | Relocated DOM and libxml extensions to dev dependencies since they're only needed for testing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| $dom = new \DOMDocument(); | ||
| $dom->loadXML($xml); | ||
| // Désactive les erreurs libxml pour les capturer |
There was a problem hiding this comment.
The comment is in French. Consider translating to English for consistency with the rest of the codebase: 'Disable libxml errors to capture them'.
| // Désactive les erreurs libxml pour les capturer | |
| // Disable libxml errors to capture them |
| }, | ||
| "require-dev": { | ||
| "phpstan/phpstan": "^2.1", | ||
| "friendsofphp/php-cs-fixer": "^3.93", | ||
| "phpunit/phpunit": "^12.5" | ||
| "phpunit/phpunit": "^12.5", | ||
| "ext-libxml": "*", |
There was a problem hiding this comment.
Moving ext-dom from require to require-dev may cause issues if the Serializer class or other production code uses DOM functionality. The new test uses DOM, but verify that no production code depends on this extension before moving it to dev dependencies.
No description provided.