From 21a04fefcfc98bd5737e231adf2f8ff631f4a2ff Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Sat, 8 Jul 2023 17:54:21 +0100 Subject: [PATCH] fix: same class on `toExtend` --- src/Expectation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Expectation.php b/src/Expectation.php index 7eef6fee..65de1239 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -542,7 +542,7 @@ final class Expectation { return Targeted::make( $this, - fn (ObjectDescription $object): bool => $object->reflectionClass->isSubclassOf($class), + fn (ObjectDescription $object): bool => $class === $object->reflectionClass->getName() || $object->reflectionClass->isSubclassOf($class), sprintf("to extend '%s'", $class), FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), );