phpunit
phpunit copied to clipboard
Conditionally include extensions on the command line
Hello, I've written an extension using the documentation and it works as expected when I enable it in my phpunit.xml
<extensions>
config. My extension is essentially a custom printer using the event system.
I would like users to be able to conditionally enable or disable it at run time, as it may not be desirable all of the time. Enabling and disabling via phpunit.xml
is pretty burdensome, so I would like to be able to do it with a command line option.
I noticed that versions before 10.x included an --extensions
command line option that is no longer present in 10.x. Is there a replacement?
Alternative: allow extensions to register valid command line options to control their behavior. This would allow me to run my extension, but only do the expected action if the user provided a particular --option
flag.
Are any of these possible with the current implementation or would they be new features? Thanks for the help! And thanks most of all for PHPUnit!