From 88e047bd279add63b92d0fa19345087ae6d631f2 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sun, 19 Mar 2023 18:34:20 +0000 Subject: [PATCH] tests: for test names starting with P --- tests/.snapshots/success.txt | 9 ++++++++- tests/Unit/TestName.php | 13 +++++++++++++ tests/Visual/Parallel.php | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 tests/Unit/TestName.php diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index 7dbe9326..82345dd7 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -910,6 +910,13 @@ ✓ it evaluates the code with ('version__ ', '__pest_evaluable_version___') ✓ it evaluates the code with ('version\', '__pest_evaluable_version_') + PASS Tests\Unit\TestName + ✓ it may start with P with ('P\Tests\BarTest', 'Tests\BarTest') + ✓ it may start with P with ('P\Packages\Foo', 'Packages\Foo') + ✓ it may start with P with ('P\PPPackages\Foo', 'PPPackages\Foo') + ✓ it may start with P with ('PPPackages\Foo', 'PPPackages\Foo') #1 + ✓ it may start with P with ('PPPackages\Foo', 'PPPackages\Foo') #2 + PASS Tests\Unit\TestSuite ✓ it does not allow to add the same test description twice ✓ it alerts users about tests with arguments but no input @@ -943,4 +950,4 @@ PASS Tests\Visual\Version ✓ visual snapshot of help command output - Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 18 skipped, 644 passed (1586 assertions) \ No newline at end of file + Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 18 skipped, 649 passed (1591 assertions) \ No newline at end of file diff --git a/tests/Unit/TestName.php b/tests/Unit/TestName.php new file mode 100644 index 00000000..3f52e700 --- /dev/null +++ b/tests/Unit/TestName.php @@ -0,0 +1,13 @@ +toBe($toBePrinted); +})->with([ + ['P\Tests\BarTest', 'Tests\BarTest'], + ['P\Packages\Foo', 'Packages\Foo'], + ['P\PPPackages\Foo', 'PPPackages\Foo'], + ['PPPackages\Foo', 'PPPackages\Foo'], + ['PPPackages\Foo', 'PPPackages\Foo'], +]); diff --git a/tests/Visual/Parallel.php b/tests/Visual/Parallel.php index a5a9d844..237345d7 100644 --- a/tests/Visual/Parallel.php +++ b/tests/Visual/Parallel.php @@ -15,6 +15,6 @@ $run = function () { }; test('parallel', function () use ($run) { - expect($run())->toContain('Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 15 skipped, 635 passed (1573 assertions)') + expect($run())->toContain('Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 15 skipped, 640 passed (1578 assertions)') ->toContain('Parallel: 3 processes'); })->skip(PHP_OS_FAMILY === 'Windows');