I am wondering about what “strict mode is in PHPUnit” ?
eg:
phpunit --strict
or in phpunit.xml
<phpunit strict="true"/>
I turned it on just to try it and my tests started failing with
PHP_Invoker_TimeoutException: Execution aborted after 1 second
Short answer:
for long running tests use an annotation to increase the allowed run time:
Long Answer:
Here is an updated set of info that was derived with the help of @Crozin.
In my case the error was that a test was taking too long (>1 second.) (Doctrine ORM schema drop + create can slow things down, see this ZendCast for what I was doing). This was causing an issue (and some output) from PHP_Invoker. Strict mode doesnt allow any output.
By Reading / Reverse engineering /usr/share/php/pear/share/pear/PHPUnit/Util/Test.php::getSize() (and getGroups() on the same class) .. I figured out there are 3 undocumented annotations we can use:
They can be specified on the class level or on the method level.
Issue #490 on the PHPUnit github hints at issues with supplying both class level and method level so YMMV if you mix them. As crozin said, the allotted time outs are 10,5,1 seconds respectively.
A alternate solution was to increase how long an invoked function is allowed to run (on my slow computer).
Here is a bunch of information about strict mode that helped me find the solution: