diff --git a/src/Support/Backtrace.php b/src/Support/Backtrace.php index 8ad285c0..87200086 100644 --- a/src/Support/Backtrace.php +++ b/src/Support/Backtrace.php @@ -99,11 +99,7 @@ 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')) { + if (str_starts_with($trace['file'], dirname(__DIR__).DIRECTORY_SEPARATOR)) { continue; } diff --git a/tests/Pest.php b/tests/Pest.php index e9433dc8..98a30f41 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -5,8 +5,6 @@ use Tests\CustomTestCaseInSubFolders\SubFolder\SubFolder\CustomTestCaseInSubFold error_reporting(E_ALL); -$GLOBALS['__PEST_INTERNAL_TEST_SUITE'] = true; - pest()->project()->github('pestphp/pest'); pest()->in('PHPUnit/CustomTestCaseInSubFolders/SubFolder/SubFolder')->use(CustomTestCaseInSubFolder::class);