feat(mock): adds work in progress

This commit is contained in:
Nuno Maduro
2021-04-10 21:11:57 +01:00
parent 3205b571b0
commit c9f723530d
7 changed files with 134 additions and 18 deletions

View File

@ -3,6 +3,7 @@
declare(strict_types=1);
use Pest\Datasets;
use Pest\Mock;
use Pest\PendingObjects\AfterEachCall;
use Pest\PendingObjects\BeforeEachCall;
use Pest\PendingObjects\TestCall;
@ -104,3 +105,15 @@ function afterAll(Closure $closure): void
{
TestSuite::getInstance()->afterAll->set($closure);
}
if (!function_exists('mock')) {
/**
* Creates a new mock with the given class or object.
*
* @param string|object $object
*/
function mock($object): Mock
{
return new Mock($object);
}
}