From ef29b4f0911df9ae433f160fe4a4d20d26f604dc Mon Sep 17 00:00:00 2001 From: Dan Mason Date: Fri, 19 Jul 2024 15:30:43 +0100 Subject: [PATCH] Include method name in toHaveMethod error message --- src/Expectation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Expectation.php b/src/Expectation.php index a410cf1d..2b2fde8a 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -515,7 +515,7 @@ final class Expectation return Targeted::make( $this, fn (ObjectDescription $object): bool => $object->reflectionClass->hasMethod($method), - 'to have method', + sprintf("to have method '%s'", $method), FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')), ); }