-
Notifications
You must be signed in to change notification settings - Fork 356
refactor: Update test case to current (PHP) standards #831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 refactors the test cases to update them to current PHP standards and improve type safety and code clarity. Key changes include:
- Replacing instance property access with class constants for test paths.
- Adding strict type hints and updated doc annotations for better maintainability.
- Removing a redundant test case and updating JSON decoding across tests.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tests/Drafts/Draft4Test.php | Removed the $schemaSpec property and updated test properties. |
tests/Drafts/Draft3Test.php | Updated file path resolution to use a class constant rather than an instance property. |
tests/Drafts/BaseDraftTestCase.php | Replaced property with a constant and updated type annotations. |
tests/Constraints/VeryBaseTestCase.php | Refactored schema retrieval methods with improved type hints and file handling. |
tests/Constraints/ConstTest.php | Updated JSON test schema to use "object" instead of "any". |
tests/Constraints/BaseTestCase.php | Updated type hints and json_decode calls for better consistency. |
tests/Constraints/ArraysTest.php | Removed a test case related to array items validation. |
CHANGELOG.md | Updated changelog reflecting these substantive test improvements. |
Comments suppressed due to low confidence (2)
tests/Drafts/Draft4Test.php:16
- The removal of the $schemaSpec property in Draft4Test may break tests that rely on it (for instance, in BaseTestCase where it is used to set the '$schema' property). Consider reintroducing $schemaSpec or refactoring the tests to remove the dependency on it.
protected $schemaSpec = 'http://json-schema.org/draft-04/schema#';
tests/Constraints/ArraysTest.php:272
- The removal of the 'items: true passes validation' test case may reduce coverage for array item validations; please confirm that its removal was intentional and that all necessary scenarios remain adequately tested.
'items: true passes validation' => [ ... ]
This PR improves the test cases classes and addresses some small fixes of issues which exposed themselves.