Merge pull request #1194 from dmason30/patch-1

Include method name in toHaveMethod error message
This commit is contained in:
Nuno Maduro
2024-07-20 18:29:37 +01:00
committed by GitHub

View File

@ -515,7 +515,7 @@ final class Expectation
return Targeted::make( return Targeted::make(
$this, $this,
fn (ObjectDescription $object): bool => $object->reflectionClass->hasMethod($method), 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')), FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
); );
} }