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 PHPUnit\Architecture\Elements\ObjectDescription;
use PHPUnit\Framework\ExpectationFailedException;
use ReflectionEnum;
/**
* @template TValue
@ -890,9 +891,10 @@ final class Expectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => (new \ReflectionEnum($object->name))->isBacked()
&& (string)(new \ReflectionEnum($object->name))->getBackingType() === $backingType,
'to be ' . $backingType . ' backed enum',
fn (ObjectDescription $object): bool => $object->reflectionClass->isEnum()
&& (new ReflectionEnum($object->name))->isBacked() // @phpstan-ignore-line
&& (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')),
);
}

View File

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

View File

@ -467,6 +467,10 @@
✓ failures with custom message
✓ not failures
PASS Tests\Features\Expect\toBeIntBackedEnum
✓ enum is backed by int
✓ enum is not backed by int
PASS Tests\Features\Expect\toBeInvokable
✓ class is invokable
✓ opposite class is invokable
@ -575,6 +579,10 @@
✓ failures with custom message
✓ not failures
PASS Tests\Features\Expect\toBeStringBackedEnum
✓ enum is backed by string
✓ enum is not backed by string
PASS Tests\Features\Expect\toBeStudlyCase
✓ pass
✓ failures
@ -1404,4 +1412,4 @@
WARN Tests\Visual\Version
- 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) {
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');
})->skipOnWindows();