Initial commit,修正
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
<?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->setAccessible(true);
|
||||
$prop->setValue($this, array());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user