diff --git a/src/Support/Backtrace.php b/src/Support/Backtrace.php index 78d7cfc7..24d856a6 100644 --- a/src/Support/Backtrace.php +++ b/src/Support/Backtrace.php @@ -30,7 +30,10 @@ final class Backtrace $traceFile = str_replace(DIRECTORY_SEPARATOR, '/', $trace[self::FILE]); - if (Str::endsWith($traceFile, 'overrides/Runner/TestSuiteLoader.php')) { + if ( + Str::endsWith($traceFile, 'overrides/Runner/TestSuiteLoader.php') || + Str::endsWith($traceFile, 'src/Bootstrappers/BootFiles.php') + ) { break; } diff --git a/tests/.snapshots/collision-parallel.txt b/tests/.snapshots/collision-parallel.txt index 020b45c0..b8c408e6 100644 --- a/tests/.snapshots/collision-parallel.txt +++ b/tests/.snapshots/collision-parallel.txt @@ -1,5 +1,5 @@ - ⨯. + .⨯. ──────────────────────────────────────────────────────────────────────────── FAILED Tests\Fixtures\CollisionTest > error Exception error @@ -19,4 +19,4 @@ 2 src/Factories/TestCaseMethodFactory.php:100 - Tests: 1 failed, 1 passed (1 assertions) \ No newline at end of file + Tests: 1 failed, 2 passed (2 assertions) \ No newline at end of file diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index db60e4ae..07446296 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -673,6 +673,7 @@ ✓ it throws error if method do not exist ✓ it can forward unexpected calls to any global function ✓ it can use helpers from helpers file + ✓ it can use helpers from helpers directory PASS Tests\Features\HigherOrderTests ✓ it proxies calls to object @@ -789,6 +790,9 @@ PASS Tests\Fixtures\ExampleTest ✓ it example 2 + PASS Tests\Helpers\TestInHelpers + ✓ it executes tests in the Helpers directory + PASS Tests\Hooks\AfterAllTest ✓ global afterAll execution order ✓ it only gets called once per file @@ -1009,4 +1013,4 @@ PASS Tests\Visual\Version ✓ visual snapshot of help command output - Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 14 skipped, 706 passed (1707 assertions) \ No newline at end of file + Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 14 skipped, 708 passed (1709 assertions) \ No newline at end of file diff --git a/tests/Features/Helpers.php b/tests/Features/Helpers.php index 90663554..e32faffa 100644 --- a/tests/Features/Helpers.php +++ b/tests/Features/Helpers.php @@ -44,3 +44,5 @@ it('throws error if method do not exist', function () { it('can forward unexpected calls to any global function')->_assertThat(); it('can use helpers from helpers file')->myAssertTrue(true); + +it('can use helpers from helpers directory')->myDirectoryAssertTrue(true); diff --git a/tests/Helpers/Helper.php b/tests/Helpers/Helper.php new file mode 100644 index 00000000..b5958142 --- /dev/null +++ b/tests/Helpers/Helper.php @@ -0,0 +1,6 @@ +assertTrue($value); +} diff --git a/tests/Helpers/TestInHelpers.php b/tests/Helpers/TestInHelpers.php new file mode 100644 index 00000000..91dcb038 --- /dev/null +++ b/tests/Helpers/TestInHelpers.php @@ -0,0 +1,5 @@ +toBeTrue(); +}); diff --git a/tests/Visual/Parallel.php b/tests/Visual/Parallel.php index 03b18ce1..51f39a23 100644 --- a/tests/Visual/Parallel.php +++ b/tests/Visual/Parallel.php @@ -18,10 +18,10 @@ $run = function () { test('parallel', function () use ($run) { expect($run('--exclude-group=integration')) - ->toContain('Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 11 skipped, 694 passed (1692 assertions)') + ->toContain('Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 11 skipped, 696 passed (1694 assertions)') ->toContain('Parallel: 3 processes'); })->skip(PHP_OS_FAMILY === 'Windows'); test('a parallel test can extend another test with same name', function () use ($run) { - expect($run('tests/Fixtures/Inheritance'))->toContain('Tests: 1 skipped, 1 passed (1 assertions)'); + expect($run('tests/Fixtures/Inheritance'))->toContain('Tests: 1 skipped, 2 passed (2 assertions)'); });