I have a test suite which has about 50 tests - each of which is testing an async network call implemented via promises. When I run PHPUnit, it executes all tests and all of them pass - everytime.
But when i use coverage, all of the tests dont run, the first test runs partially and the script exits, with no coverage generated. Any help?
This is my command:
phpunit --coverage-html ./coverage --debug --verbose tests/
My code is something like this:
class ClassToTest
{
function foo($callback)
{
//asynchronously do something, trigger callback when done.
}
}
class Test
{
function testFoo()
{
$count = 1;
$obj->foo( new function() {
$obj->foo( new function() {
$obj->foo( new function() {
$count = 0;
});
});
});
// check if $count == 0, exit. If not, then sleep for sometime and repeat.
}
}
I am using PHP 5.6.6
I tried running the same thing with PHPStorm, and I finally got an error code in its console. This is what it says:
Process finished with exit code -1073740940 (0xC0000374)
Found no support for this error. Any help appreciated. Thanks.