Skip to content
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

Fix tests with phpunit10 #6220

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Fix tests with phpunit10 #6220

wants to merge 8 commits into from

Conversation

tenzap
Copy link
Contributor

@tenzap tenzap commented Jun 19, 2023

This will fix the errors, warning & deprecations when testing with phpunit10
Pick whatever you may find relevant and a correct fix.

It is assumed this is run with phpunit 10.2 & php 8.2 (and that the php8.2 fixes of #6173 are already applied.

Might close #6219

@tenzap tenzap force-pushed the phpunit10 branch 2 times, most recently from d00f88f to 055438a Compare June 19, 2023 18:50
@tenzap
Copy link
Contributor Author

tenzap commented Jun 20, 2023

All commits except one work also when run on phpunit9.
The one that doesn't work with phpunit9 is the one changing for assertObjectHasProperty

@tenzap
Copy link
Contributor Author

tenzap commented Jun 21, 2023

All commits except one work also when run on phpunit9. The one that doesn't work with phpunit9 is the one changing for assertObjectHasProperty

Commit updated, it should now run on older phpunit versions too.

 Output was produced with:
 .
   phpunit --migrate-configuration
 .
 Error was:
 .
 Warning:       Your XML configuration validates against a deprecated schema.
 Suggestion:    Migrate your XML configuration using "--migrate-configuration"!
 Produced by: phpunit --migrate-configuration
 Fatal error: Cannot override final method PHPUnit\Framework\TestCase::runBare() in tests/mocks/ci_testcase.php on line 351
 Was removed in phpunit10

 Error: Call to undefined method PHPUnit\Framework\MockObject\MockBuilder::setMethods()
 1) Class security_helper_test cannot be found in tests/codeigniter/helpers/security_helper_test.php
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.

Fix deprecations for phpunit 10, and maybe update to phpunit10
1 participant