Allow traits to be covered

This commit is contained in:
Tim Smith
2023-05-05 17:59:52 +01:00
parent a34767fa15
commit 963b7f43ab

View File

@ -227,7 +227,7 @@ final class TestCall
public function covers(string ...$classesOrFunctions): self
{
foreach ($classesOrFunctions as $classOrFunction) {
$isClass = class_exists($classOrFunction);
$isClass = class_exists($classOrFunction) || trait_exists($classOrFunction);
$isMethod = function_exists($classOrFunction);
if (! $isClass && ! $isMethod) {