thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

PHPUnit duplicates the output, first one is terminated #2138

Closed kszcode closed 4 years ago

kszcode commented 6 years ago

Description:

PHPUnit behaves weird both in command line and in PHPStorm.

Steps To Reproduce:

  1. Install clean Laravel project. 1.1. run phpunit output is fine
    
    PHPUnit 6.4.3 by Sebastian Bergmann and contributors.

.. 2 / 2 (100%)

Time: 603 ms, Memory: 12.00MB

2. run `composer require tcg/voyager`
3. run `phpunit`, output is doubled

PHPUnit 6.4.3 by Sebastian Bergmann and contributors.

PHPUnit 6.4.3 by Sebastian Bergmann and contributors.

.. 2 / 2 (100%)

Time: 318 ms, Memory: 14.00MB

OK (2 tests, 2 assertions)


## Solution: 

It turns out that when Larapack\Hooks\Hooks object is constructed it's doing a 
    $xdebug = new XdebugHandler($output);
    $xdebug->check();

During the check function it calls the exit() function, when the environment is in a certain state.

Not sure yet why this is happening, however if anyone needs to investigate this further, now you have a lead on it.
fletch3555 commented 6 years ago

Good find. We'll need to look a little deeper for the actual solution, but this is definitely a solid start. Might be an issue for the Larapack\Hooks repo though.

blong14 commented 6 years ago

This also kills code coverage. I added this in my environment and things seem to work but not sure what its actually doing:

export COMPOSER_ALLOW_XDEBUG=1

MrCrayon commented 4 years ago

This was fixed in https://github.com/larapack/hooks/pull/26

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.