From aaee0e420bb0788544c8f4cb2387cb27e19f3bbd Mon Sep 17 00:00:00 2001 From: Sandro Gehri Date: Wed, 8 Nov 2023 14:22:21 +0100 Subject: [PATCH] Fix covers function to accept traits --- src/PendingCalls/TestCall.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PendingCalls/TestCall.php b/src/PendingCalls/TestCall.php index c2bd365c..f675dddd 100644 --- a/src/PendingCalls/TestCall.php +++ b/src/PendingCalls/TestCall.php @@ -526,8 +526,8 @@ final class TestCall $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) {