first commit
This commit is contained in:
16
vendor/codeception/stub/tests/ResetMocks.php
vendored
Normal file
16
vendor/codeception/stub/tests/ResetMocks.php
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
trait ResetMocks
|
||||
{
|
||||
protected function resetMockObjects()
|
||||
{
|
||||
$refl = new ReflectionObject($this);
|
||||
while (!$refl->hasProperty('mockObjects')) {
|
||||
$refl = $refl->getParentClass();
|
||||
}
|
||||
$prop = $refl->getProperty('mockObjects');
|
||||
$prop->setValue($this, array());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user