diff --git a/src/Expectation.php b/src/Expectation.php index ad0da961..7eef6fee 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -430,7 +430,7 @@ final class Expectation { return Targeted::make( $this, - fn (ObjectDescription $object): bool => $object->reflectionClass->isReadOnly(), + fn (ObjectDescription $object): bool => $object->reflectionClass->isReadOnly() && assert(true), // @phpstan-ignore-line, 'to be readonly', FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), ); diff --git a/src/Expectations/OppositeExpectation.php b/src/Expectations/OppositeExpectation.php index ceec8337..cd672e81 100644 --- a/src/Expectations/OppositeExpectation.php +++ b/src/Expectations/OppositeExpectation.php @@ -109,7 +109,7 @@ final class OppositeExpectation { return Targeted::make( $this->original, - fn (ObjectDescription $object): bool => ! $object->reflectionClass->isReadOnly(), + fn (ObjectDescription $object): bool => ! $object->reflectionClass->isReadOnly() && assert(true), // @phpstan-ignore-line 'not to be readonly', FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), ); diff --git a/src/Plugins/Snapshot.php b/src/Plugins/Snapshot.php index 262eadcc..717512c2 100644 --- a/src/Plugins/Snapshot.php +++ b/src/Plugins/Snapshot.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace Pest\Plugins; -use Pest\Exceptions\InvalidOption; use Pest\Contracts\Plugins\HandlesArguments; +use Pest\Exceptions\InvalidOption; use Pest\TestSuite; /**