14 lines
361 B
PHP
14 lines
361 B
PHP
<?php
|
|
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());
|
|
}
|
|
} |