fix: removes process-isolation from --help output

This commit is contained in:
Nuno Maduro
2024-01-25 17:27:03 +00:00
parent 607a4906ac
commit cb1735f4d8
4 changed files with 19 additions and 8 deletions

View File

@ -32,6 +32,7 @@ use Pest\Matchers\Any;
use Pest\Support\ExpectationPipeline; use Pest\Support\ExpectationPipeline;
use PHPUnit\Architecture\Elements\ObjectDescription; use PHPUnit\Architecture\Elements\ObjectDescription;
use PHPUnit\Framework\ExpectationFailedException; use PHPUnit\Framework\ExpectationFailedException;
use ReflectionEnum;
/** /**
* @template TValue * @template TValue
@ -890,9 +891,10 @@ final class Expectation
{ {
return Targeted::make( return Targeted::make(
$this, $this,
fn (ObjectDescription $object): bool => (new \ReflectionEnum($object->name))->isBacked() fn (ObjectDescription $object): bool => $object->reflectionClass->isEnum()
&& (string)(new \ReflectionEnum($object->name))->getBackingType() === $backingType, && (new ReflectionEnum($object->name))->isBacked() // @phpstan-ignore-line
'to be ' . $backingType . ' backed enum', && (string) (new ReflectionEnum($object->name))->getBackingType() === $backingType, // @phpstan-ignore-line
'to be '.$backingType.' backed enum',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
); );
} }

View File

@ -493,9 +493,10 @@ final class OppositeExpectation
{ {
return Targeted::make( return Targeted::make(
$this->original, $this->original,
fn (ObjectDescription $object): bool => (new \ReflectionEnum($object->name))->isBacked() fn (ObjectDescription $object): bool => ! $object->reflectionClass->isEnum()
&& (string)(new \ReflectionEnum($object->name))->getBackingType() !== $backingType, || ! (new \ReflectionEnum($object->name))->isBacked() // @phpstan-ignore-line
'not to be ' . $backingType . ' backed enum', || (string) (new \ReflectionEnum($object->name))->getBackingType() !== $backingType, // @phpstan-ignore-line
'not to be '.$backingType.' backed enum',
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
); );
} }

View File

@ -467,6 +467,10 @@
✓ failures with custom message ✓ failures with custom message
✓ not failures ✓ not failures
PASS Tests\Features\Expect\toBeIntBackedEnum
✓ enum is backed by int
✓ enum is not backed by int
PASS Tests\Features\Expect\toBeInvokable PASS Tests\Features\Expect\toBeInvokable
✓ class is invokable ✓ class is invokable
✓ opposite class is invokable ✓ opposite class is invokable
@ -575,6 +579,10 @@
✓ failures with custom message ✓ failures with custom message
✓ not failures ✓ not failures
PASS Tests\Features\Expect\toBeStringBackedEnum
✓ enum is backed by string
✓ enum is not backed by string
PASS Tests\Features\Expect\toBeStudlyCase PASS Tests\Features\Expect\toBeStudlyCase
✓ pass ✓ pass
✓ failures ✓ failures
@ -1404,4 +1412,4 @@
WARN Tests\Visual\Version WARN Tests\Visual\Version
- visual snapshot of help command output - visual snapshot of help command output
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 20 skipped, 995 passed (2391 assertions) Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 20 skipped, 1003 passed (2407 assertions)

View File

@ -16,7 +16,7 @@ $run = function () {
test('parallel', function () use ($run) { test('parallel', function () use ($run) {
expect($run('--exclude-group=integration')) expect($run('--exclude-group=integration'))
->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 16 skipped, 982 passed (2372 assertions)') ->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 16 skipped, 990 passed (2388 assertions)')
->toContain('Parallel: 3 processes'); ->toContain('Parallel: 3 processes');
})->skipOnWindows(); })->skipOnWindows();