Closed eithed closed 6 years ago
That is no good. Thanks for reporting, I will look into this.
I've tried debugging it yesterday, but even when I removed the:
"extra": {
"laravel": {
"providers": [
"Larapack\\VoyagerHooks\\VoyagerHooksServiceProvider"
]
}
}
in package composer.json (per suggestion in Laravel's ticket) the service provider is still discovered. One way to get around the issue is per SO answer (putting <env name="COMPOSER_ALLOW_XDEBUG" value="1"/>
in phpunit.xml
), or preventing autodiscovery for the package by putting:
"extra": {
"laravel": {
"dont-discover": [
"larapack/voyager-hooks"
]
}
},
in the projects composer.json (although I don't know what that will do). Both of the solutions are not ideal, but debugging the issue further, and the why's/how's is currently beyond me. Thanks!
Before we had auto discovering on, it was added to the VoyagerServiceProvider, you will have to remove it from there as well. However, if you do, please let me know if that resolves the issue.
I don't think it will - bear in mind that I was able to encounter the issue without even installing Voyager.
I would test it - if it wasn't for the current issues with packagist.org... Will get back later once I have tested it.
@eithed: Can you do me a favour and try to remove the line $xdebug->check();
from vendor/larapack/hooks/src/Hooks.php
and see if that fixes the issue?
Cause then I will remake that and send in a PR.
Yup - that fixes the issue
This has been fixed in larapack/hooks:v1.0.3
🎉
Description:
Following the change in https://laravel.com/docs/5.5/packages#package-discovery the
VoyagerHooksServiceProvider
included runs at the App intialisation, which means that by default xdebug will get disabled, and trying to run any functionality dependant on it (in my case - phpunit to obtain code coverage) will fail just becauselarapack/voyager-hooks
is installed.I've created a SO question for this issue: https://stackoverflow.com/questions/48118973/different-php-ini-file-loaded-dependant-upon-the-code-content/ as well as reported this on Laravel bugtracker: https://github.com/laravel/framework/issues/22782
Steps To Reproduce:
larapack\voyager-hooks
phpunit tests/unit/atest
fortests/unit/ATest.php
with following content:Output: C:\Users[user]\AppData\Local\Temp\F2A5.tmp Expected output: C:\server\php\php.ini