tests: for test names starting with P

This commit is contained in:
Nuno Maduro
2023-03-19 18:34:20 +00:00
parent 8f630c064f
commit 88e047bd27
3 changed files with 22 additions and 2 deletions

View File

@ -910,6 +910,13 @@
✓ it evaluates the code with ('version__ ', '__pest_evaluable_version___') ✓ it evaluates the code with ('version__ ', '__pest_evaluable_version___')
✓ 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 PASS Tests\Unit\TestSuite
✓ it does not allow to add the same test description twice ✓ it does not allow to add the same test description twice
✓ it alerts users about tests with arguments but no input ✓ it alerts users about tests with arguments but no input
@ -943,4 +950,4 @@
PASS Tests\Visual\Version PASS Tests\Visual\Version
✓ visual snapshot of help command output ✓ visual snapshot of help command output
Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 18 skipped, 644 passed (1586 assertions) Tests: 2 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 18 skipped, 649 passed (1591 assertions)

13
tests/Unit/TestName.php Normal file
View File

@ -0,0 +1,13 @@
<?php
it('may start with P', function (string $real, string $toBePrinted) {
$printed = preg_replace('/P\\\/', '', $real, 1);
expect($printed)->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'],
]);

View File

@ -15,6 +15,6 @@ $run = function () {
}; };
test('parallel', function () use ($run) { 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'); ->toContain('Parallel: 3 processes');
})->skip(PHP_OS_FAMILY === 'Windows'); })->skip(PHP_OS_FAMILY === 'Windows');