Closed johnkary closed 3 years ago
I'm confused as why this wasn't working, and I saw it isn't part of 3.2 release. was that an oversight? https://github.com/johnkary/phpunit-speedtrap/compare/v3.2.0...master Thanks for the great work!
Hi @MarkVaughn, Sorry for the confusion. This ticket should have been closed when #66 was merged. Feature #66 is complete and now part of tagged version v3.3.0.
I originally thought this feature would be part of a v4.0 release. When you left that comment, it was merged to master, but not yet tagged on a release.
v4.0 will still happen and update to using PHPUnit's hooks system via #67.
PHPUnit may be configured with runtime options that alter its output or generated reports, such as
--coverage-html
or--log-junit
or--testdox-html
Currently the slowness report is output on every test suite execution when SpeedTrapListener is enabled in phpunit.xml. This may not be desired when running PHPUnit with other options. For example, generating code coverage via
--coverage-html
is an opt-in runtime option. SpeedTrap should behave similarly.Instead, the slowness report should only output when at least one of the following is true:
--speedtrap
PHPUNIT_SPEEDTRAP
has a string value of "enabled"PHP environment variables can be set in
php.ini
or any method supported by PHP.PHP environment variables can also be set using
phpunit.xml
:Feedback requested
--speedtrap
for runtime option? I'm not sure if/how this option's presence can be detected by the listener, but it can probably be done.PHPUNIT_SPEEDTRAP
for the environment variable? This name scopes it into a fake namespace (PHPUNIT) and specific to this library (SPEEDTRAP).