mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
feat(mock): adds work in progress
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user