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
All Tracebacks show PHPUnit classes after using this interface
How to reproduce
PHPUnit\Util\ExcludeList::addDirectory(__DIR__);
Failing assert shows a long stacktrace with files in
/vendor/phpunit/phpunit/src/
Workaround:
$excludeList = new \PHPUnit\Util\ExcludeList();
if (!$excludeList->isExcluded(__FILE__)) {
// Add directory after initialize ExcludeList::$directories via isExcluded
\PHPUnit\Util\ExcludeList::addDirectory(__DIR__);
}
should be in the compatibility promise and ExcludeList will initialize itself properly,
Later tracebacks won’t show PHPUnit internal files and user added directories.
As the backward compatibility promise isn’t clear, please provide a stable interface.
(As there isn't a static function to check the directories, it would be nice if a directory won't be added as duplicate to the internal list)
The text was updated successfully, but these errors were encountered:
sebastianbergmann
changed the title
ExcludeList::addDirectory won’t initialize correctly, assert tracebacks will show PHPUnit classes
ExcludeList::addDirectory() does not work correctly
Aug 13, 2022
Summary
PHPUnit\Util\ExcludeList
won’t initialize correctly when staticaddDirectory
is called before a class instance was created.This interface is required to create new custom asserts without showing internals in the stacktrace.
As introduced and described in #4186
Current behavior
PHPUnit\Util\ExcludeList::addDirectory
won’t initializeExcludeList ::$directories
correctly.All Tracebacks show PHPUnit classes after using this interface
How to reproduce
PHPUnit\Util\ExcludeList::addDirectory(__DIR__);
Failing assert shows a long stacktrace with files in
/vendor/phpunit/phpunit/src/
Workaround:
Expected behavior
PHPUnit\Util\ExcludeList::addDirectory($directory);
should be in the compatibility promise and ExcludeList will initialize itself properly,
Later tracebacks won’t show PHPUnit internal files and user added directories.
As the backward compatibility promise isn’t clear, please provide a stable interface.
(As there isn't a static function to check the directories, it would be nice if a directory won't be added as duplicate to the internal list)
The text was updated successfully, but these errors were encountered: