feat: adds covers

This commit is contained in:
Nuno Maduro
2024-09-05 00:10:29 +01:00
parent dd20323ca7
commit 65f74f620c
2 changed files with 14 additions and 1 deletions

View File

@ -211,3 +211,16 @@ if (! function_exists('afterAll')) {
TestSuite::getInstance()->afterAll->set($closure);
}
}
if (! function_exists('covers')) {
/**
* Specifies which classes, or functions, a test method covers.
*/
function covers(string ...$classesOrFunctions): void
{
$filename = Backtrace::file();
(new BeforeEachCall(TestSuite::getInstance(), $filename))
->covers(...$classesOrFunctions);
}
}