1 | <?php |
||
13 | trait PrivateClassMethodTrait |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * Testing private methods for a class. |
||
18 | * |
||
19 | * $class = new YourClass(); or service... |
||
20 | * $method = $this->getPrivateClassMethod(get_class($class), 'getPrivateFunction'); |
||
21 | * $result = $method->invokeArgs( $this->activityManager, [argument1, argument2, ...]); |
||
22 | * |
||
23 | * @param string $className String name for class, full namespace. |
||
24 | * @param string $methodName Method name to be used |
||
25 | * |
||
26 | * @return \ReflectionMethod |
||
27 | * @throws \ReflectionException |
||
28 | */ |
||
29 | public function getPrivateClassMethod($className, $methodName) |
||
36 | |||
37 | /** |
||
38 | * provide a protected property of a given object. |
||
39 | * |
||
40 | * @param string $className String name for class, full namespace. |
||
41 | * @param string $propertyName property name |
||
42 | * |
||
43 | * @return \ReflectionProperty |
||
44 | * @throws \ReflectionException |
||
45 | */ |
||
46 | public function getPrivateClassProperty($className, $propertyName) |
||
53 | } |
||
54 |