You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed an issue where if the logging middleware has been enabled, PHPUnit won't be able to complete the code coverage report and show it within PhpStorm. Please see the screenshot below:
As you can see on line 10, it's destructing the Middleware class once the code has finished executing. Typically, whenever the Target class [config] does not exist. exception is thrown, something is being called at the wrong time e.g. similar to using a Laravel factory in a @dataProvider or using Container methods within the setUp before the application has actually been able to boot up.
I've tried debugging for the last 20 minutes or so and the cause is this line:
And of course, adding DOCTRINE_MIDDLEWARE=Doctrine\DBAL\Logging\Middleware to your .env.
I think this "solution" is a bit ugly. It does give a better ability to enable and disable middleware based on your environment. I haven't tested caching the configuration, yet.. although, I wouldn't anticipate any issues doing so.
It could be possible I've put a piece of code in the wrong place, so I'll use my fix for the time being. I'll update this issue should I find the root cause (if one exists).
I've noticed an issue where if the logging middleware has been enabled, PHPUnit won't be able to complete the code coverage report and show it within PhpStorm. Please see the screenshot below:
As you can see on line 10, it's destructing the
Middleware
class once the code has finished executing. Typically, whenever theTarget class [config] does not exist.
exception is thrown, something is being called at the wrong time e.g. similar to using a Laravel factory in a@dataProvider
or usingContainer
methods within thesetUp
before the application has actually been able to boot up.I've tried debugging for the last 20 minutes or so and the cause is this line:
orm/config/doctrine.php
Lines 90 to 92 in 106f0dc
A possible fix is:
And of course, adding
DOCTRINE_MIDDLEWARE=Doctrine\DBAL\Logging\Middleware
to your.env
.I think this "solution" is a bit ugly. It does give a better ability to enable and disable middleware based on your environment. I haven't tested caching the configuration, yet.. although, I wouldn't anticipate any issues doing so.
It could be possible I've put a piece of code in the wrong place, so I'll use my fix for the time being. I'll update this issue should I find the root cause (if one exists).
@eigan What are your thoughts?
The text was updated successfully, but these errors were encountered: