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

Phpunit 9 compatibility #30

Closed
wants to merge 3 commits into from
Closed

Phpunit 9 compatibility #30

wants to merge 3 commits into from

Conversation

verschuur
Copy link

There is a compatiblity error with PHPUnit 9. When using this printer, the following error occurs:

 Class Sempro\PHPUnitPrettyPrinter\PrettyPrinter cannot extend from interface PHPUnit\TextUI\ResultPrinter

This is due to a class which was marked internal in 8 which is now an interface in 9. Check out sebastianbergmann/phpunit#4024 for more info.

This pull request changes the parent class so the printer functions again. The downside is that there is no backwards compatibility with earlier versions of PHPUnit.

Let me know what you think :)

For some reason, in phpunit 7 and 8 it was ok to have a class with a different name in the file. 9 wouldn’t allow it so I changed the class name to match the filename.
In PHPUnit 9, the ResultPrinter is an interface so using the printer would generate an error. By changed the base Printer class to DefaultResultPrinter functionality is restored.
Due to internal changes between phpunit 8 & 9, this update breaks backwards compatiblity with with any phpunit version lower than 9.
@verschuur
Copy link
Author

Also, Travis needs PHP 7.3 due to dependency constraints ;)

@ventrec
Copy link
Member

ventrec commented Sep 11, 2020

Thanks for your contribution. We decided to merge an other PR to solve this.

@ventrec ventrec closed this Sep 11, 2020
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.

None yet

2 participants