Skip to content

chore: Add test to validate xsd schema#6

Merged
qdequippe merged 1 commit intomainfrom
test-schema-valid
Feb 3, 2026
Merged

chore: Add test to validate xsd schema#6
qdequippe merged 1 commit intomainfrom
test-schema-valid

Conversation

@qdequippe
Copy link
Copy Markdown
Collaborator

No description provided.

@qdequippe qdequippe requested a review from Copilot February 3, 2026 16:35
@qdequippe qdequippe self-assigned this Feb 3, 2026
@qdequippe qdequippe enabled auto-merge (squash) February 3, 2026 16:35
@qdequippe qdequippe merged commit 7fadc48 into main Feb 3, 2026
5 checks passed
@qdequippe qdequippe deleted the test-schema-valid branch February 3, 2026 16:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-dom and added ext-libxml from 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
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is in French. Consider translating to English for consistency with the rest of the codebase: 'Disable libxml errors to capture them'.

Suggested change
// Désactive les erreurs libxml pour les capturer
// Disable libxml errors to capture them

Copilot uses AI. Check for mistakes.
Comment on lines 19 to +24
},
"require-dev": {
"phpstan/phpstan": "^2.1",
"friendsofphp/php-cs-fixer": "^3.93",
"phpunit/phpunit": "^12.5"
"phpunit/phpunit": "^12.5",
"ext-libxml": "*",
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants