Skip to content

Commit

Permalink
Fix covers function to accept traits
Browse files Browse the repository at this point in the history
  • Loading branch information
gehrisandro committed Sep 5, 2024
1 parent 772448d commit aaee0e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PendingCalls/TestCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ public function covers(array|string ...$classesOrFunctions): self
$isTrait = trait_exists($classOrFunction);
$isFunction = function_exists($classOrFunction);

if (! $isClass && ! $isFunction) {
throw new InvalidArgumentException(sprintf('No class or method named "%s" has been found.', $classOrFunction));
if (! $isClass && ! $isTrait && ! $isFunction) {
throw new InvalidArgumentException(sprintf('No class, trait or method named "%s" has been found.', $classOrFunction));
}

if ($isClass) {
Expand Down

0 comments on commit aaee0e4

Please sign in to comment.