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')),
);
}