Skip to content

Commit

Permalink
Include method name in toHaveMethod error message
Browse files Browse the repository at this point in the history
  • Loading branch information
dmason30 authored Jul 19, 2024
1 parent ef12012 commit ef29b4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Expectation.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ public function toHaveMethod(string $method): ArchExpectation
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')),
);
}
Expand Down

0 comments on commit ef29b4f

Please sign in to comment.