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

printerClass deprecated on PHPUnit 10 #4807

Closed
nunomaduro opened this issue Oct 23, 2021 · 9 comments
Closed

printerClass deprecated on PHPUnit 10 #4807

nunomaduro opened this issue Oct 23, 2021 · 9 comments

Comments

@nunomaduro
Copy link

On the PHPUnit 10 changelog, I've just saw the following entry:

Removed the printerClass and printerFile attributes on the <phpunit> XML configuration element

At Laravel, and Pest PHP, we use this option to provider our own printer. Any workaround? If not, could you consider to revert this deprecation? Thank you!

@nunomaduro nunomaduro added the type/enhancement A new idea that should be implemented label Oct 23, 2021
@sebastianbergmann
Copy link
Owner

If not, could you consider to revert this deprecation?

This is not a deprecation, this is a removal. Everything related to this has been removed (or will be removed by the time PHPUnit 10 is released).

Any workaround?

All output, to the console as well as to logfiles etc., in PHPUnit 10 will be event-based. While the initial work on the event system itself is complete, we are currently in the process of migrating all internal functionality of PHPUnit to it. For instance, the JUnit XML logging has already been migrated. The TeamCity logging will be next. PHPUnit's own console printer(s) come(s) after that.

Once we have migrated all internal functionality of PHPUnit from TestListener and ResultPrinter to events we will remove the remaining code related to the interfaces and classes from the code base. Then (at the latest, ideally earlier and in parallel to that) we will create the functionality (APIs and configuration options) required to allow projects like Pest to subscribe to events. Pest, for instance, will want to configure PHPUnit's test runner to not produce any output (already possible) and then subscribe to the relevant events to produce output in its own format.

I am closing this issue now and kindly ask you ask additional questions on #4676. I promise to let you know when we are ready for projects such as Pest to experiment with the event system, but we are just not there yet.

@sebastianbergmann sebastianbergmann removed the type/enhancement A new idea that should be implemented label Oct 24, 2021
@nunomaduro
Copy link
Author

Thank you for the feedback. 👍🏻

@Jean85
Copy link
Contributor

Jean85 commented Oct 27, 2021

Thank you Sebastian. I'm interested in the same stuff, and I started working on the same migration in facile-it/paraunit#162. The new event system is great and I was able to monkey patch into it leveraging --bootstrap, but surely having a clear hook point would be great.

So, if we want to make this happen sooner, the only think we can do is help with the migration of the other internal features, right? I'll see if I can do something about it.

@Jean85
Copy link
Contributor

Jean85 commented Oct 27, 2021

@sebastianbergmann
Copy link
Owner

Thank you for offering to help. I will get back to you once I know what I can delegate and how.

@nunomaduro
Copy link
Author

nunomaduro commented Oct 28, 2021

@sebastianbergmann I've already migrated Pest ( except the printer stuff ) to the new Event system in a development branch. The new event stuff is awesome, I didn't extend a single class. 👏🏻

@sebastianbergmann
Copy link
Owner

@sebastianbergmann I've already migrated Pest ( except the printer stuff ) to the new Event system in a development branch. The new event stuff is awesome, I didn't extend a single class. 👏🏻

Wow!, that is great to hear. Thanks for sharing!

@localheinz
Copy link
Collaborator

@nunomaduro

Glad to hear that it works well for you!

@rvanlaak
Copy link

rvanlaak commented Oct 29, 2021

@nunomaduro sounds great! Was looking for a PR for inspiration, but it probably isn't pestphp/pest#263 that I was looking for. Could you share some of your insights?

For paraunit this PR looks great already: https://github.com/facile-it/paraunit/pull/162/files

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

No branches or pull requests

5 participants