mirror of
https://github.com/elyby/accounts.git
synced 2024-10-30 15:33:21 +05:30
18 lines
394 B
PHP
18 lines
394 B
PHP
|
<?php
|
||
|
namespace tests\codeception\common\_support;
|
||
|
|
||
|
use Codeception\Module;
|
||
|
use ReflectionClass;
|
||
|
|
||
|
trait ProtectedCaller {
|
||
|
|
||
|
protected function callProtected($object, string $function, ...$args) {
|
||
|
$class = new ReflectionClass($object);
|
||
|
$method = $class->getMethod($function);
|
||
|
$method->setAccessible(true);
|
||
|
|
||
|
return $method->invokeArgs($object, $args);
|
||
|
}
|
||
|
|
||
|
}
|