accounts/common/tests/_support/ProtectedCaller.php
ErickSkrauch 25f1ca912c Fix tests
2019-12-05 00:52:36 +03:00

22 lines
418 B
PHP

<?php
declare(strict_types=1);
namespace common\tests\_support;
use ReflectionClass;
/**
* @deprecated
*/
trait ProtectedCaller {
protected function callProtected(object $object, string $methodName, ...$args) {
$class = new ReflectionClass($object);
$method = $class->getMethod($methodName);
$method->setAccessible(true);
return $method->invokeArgs($object, $args);
}
}