Skip to content

chore: phpunit 10 support#3242

Open
yenfryherrerafeliz wants to merge 19 commits intoaws:masterfrom
yenfryherrerafeliz:chore_php_unit_10
Open

chore: phpunit 10 support#3242
yenfryherrerafeliz wants to merge 19 commits intoaws:masterfrom
yenfryherrerafeliz:chore_php_unit_10

Conversation

@yenfryherrerafeliz
Copy link
Contributor

Description of changes:

  • Make data provider static functions
  • Use class attributes instead of annotations for @dataProvider and @Covers.
  • Remove/Replace the usage of expectDeprecation, expectDeprecationMessage, expectDeprecationMessageMatches, expectError, expectErrorMessage, expectNotice, expectNoticeMessage, expectWarning, and expectWarningMessage.
  • Migrate phpunit xml config file.
  • Add XDEBUG_MODE set to coverage in the Make file definition step for running tests.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Instead of using expectDeprecation now we use expectException but we do use the set_error_handler
to throw that expected exceptions when expecting warnings or user notices.
Enhance data providers within test cases to avoid the usage of instance members since they become now static functions.
- expectWarning, expectError, expectError, etc. were removed in PHPUnit 10, and a workaround was used in order to replace the usage of those APIs.
The replacement is to use set_error_handler to catch the alert, throw a RuntimeException, and then expect this thrown exception.
- Remove constructor override for TestCase extension.
- Remove CoverClass from methods.
@yenfryherrerafeliz yenfryherrerafeliz marked this pull request as ready for review January 30, 2026 21:25
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.

1 participant