-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Allow to enable/disable pretty print via CLI #1
Comments
Hi, thanks for creating the isuse :) 👍 I don't use PHPUnit internals much, so not sure this is possible. In PHPUnit 9 there was a "printer" option: https://github.com/indentno/phpunit-pretty-print vendor/bin/phpunit --printer 'Sempro\PHPUnitPrettyPrinter\PrettyPrinter' tests/ But I can't find it in PHPUnit 10 options: vendor/bin/phpunit -h | grep "printer"
> |
@TomasVotruba there's indeed no printer option in PHPUnit 10 anymore, everything is managed through extensions. What I'd suggest to do is something like this: <extensions>
<bootstrap class="RobinIngelbrecht\PHPUnitPrettyPrint\PhpUnitExtension">
<parameter name="enabled" value="true|false"/>
</bootstrap>
</extensions> or at runtime > vendor/bin/phpunit -d --enable-pretty-print The default value of this new option would always be "true". Your use case could then be solved by setting your XML to <extensions>
<bootstrap class="RobinIngelbrecht\PHPUnitPrettyPrint\PhpUnitExtension">
<parameter name="enabled" value="false"/>
</bootstrap>
</extensions> and run > vendor/bin/phpunit -d --enable-pretty-print What do you think? |
That seems great, I'd love to use this 👍 Does this work already? |
@TomasVotruba no, something I need to implement still. I'll try to finish this this week. Maybe tomorrow :) |
@robiningelbrecht Awesome, thank you for helpling out 👍 |
@TomasVotruba, see #2, what do you think? |
@TomasVotruba released a new version 1.2.2 |
Thank you 👏 |
Currently when adding the extension in the PHPUnit XML file, the output is always prettified. It should be possible to enable/disable this with an argument in the CLI command
Requested by @TomasVotruba in indentno/phpunit-pretty-print#47
@TomasVotruba suggestion on how you would approach this?
The text was updated successfully, but these errors were encountered: