fix: adjusts backtrace for pest's internal test suite

This commit is contained in:
Nuno Maduro
2024-01-25 15:00:04 +00:00
parent 79da02c500
commit 887bed3d45
2 changed files with 6 additions and 0 deletions

View File

@ -115,6 +115,10 @@ final class Backtrace
continue; continue;
} }
if (($GLOBALS['__PEST_INTERNAL_TEST_SUITE'] ?? false) && str_contains($trace['file'], 'pest'.DIRECTORY_SEPARATOR.'src')) {
continue;
}
if (str_contains($trace['file'], DIRECTORY_SEPARATOR.'pestphp'.DIRECTORY_SEPARATOR.'pest'.DIRECTORY_SEPARATOR.'src')) { if (str_contains($trace['file'], DIRECTORY_SEPARATOR.'pestphp'.DIRECTORY_SEPARATOR.'pest'.DIRECTORY_SEPARATOR.'src')) {
continue; continue;
} }

View File

@ -3,6 +3,8 @@
use Tests\CustomTestCase\CustomTestCase; use Tests\CustomTestCase\CustomTestCase;
use Tests\CustomTestCaseInSubFolders\SubFolder\SubFolder\CustomTestCaseInSubFolder; use Tests\CustomTestCaseInSubFolders\SubFolder\SubFolder\CustomTestCaseInSubFolder;
$GLOBALS['__PEST_INTERNAL_TEST_SUITE'] = true;
uses(CustomTestCaseInSubFolder::class)->in('PHPUnit/CustomTestCaseInSubFolders/SubFolder/SubFolder'); uses(CustomTestCaseInSubFolder::class)->in('PHPUnit/CustomTestCaseInSubFolders/SubFolder/SubFolder');
// test case for all the directories inside PHPUnit/GlobPatternTests/SubFolder/ // test case for all the directories inside PHPUnit/GlobPatternTests/SubFolder/