diff --git a/src/Support/Backtrace.php b/src/Support/Backtrace.php index f08ecd6e..03001976 100644 --- a/src/Support/Backtrace.php +++ b/src/Support/Backtrace.php @@ -115,6 +115,10 @@ final class Backtrace 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')) { continue; } diff --git a/tests/Pest.php b/tests/Pest.php index 4499f0a5..6f40b03e 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -3,6 +3,8 @@ use Tests\CustomTestCase\CustomTestCase; use Tests\CustomTestCaseInSubFolders\SubFolder\SubFolder\CustomTestCaseInSubFolder; +$GLOBALS['__PEST_INTERNAL_TEST_SUITE'] = true; + uses(CustomTestCaseInSubFolder::class)->in('PHPUnit/CustomTestCaseInSubFolders/SubFolder/SubFolder'); // test case for all the directories inside PHPUnit/GlobPatternTests/SubFolder/