mocking-method-invoker
Any methods invoker for Mock object., (*1)
, (*2)
Install
Add feedtailor/mocking-method-invoker as a dependency in your project's composer.json file., (*3)
{
"require": {
"feedtailor/mocking-method-invoker": "dev-master"
}
}
Example
use Feedtailor\Mocking\MethodInvoker;
class ExampleClass
{
protected function add($a, $b)
{
return $a + $b;
}
}
$obj = new ExampleClass();
$result = MethodInvoker::create($obj)->invoke("getFoo", array(40, 2)) // got 42.
Methods
$invoker = new MethodInvoker($obj);
$invoker = MethodInvoker::create($obj);
Create a new MethodInvoker instance., (*4)
$invoker->invoke($name, $args);
invoke the $name method with $args array arguments., (*5)
License
Licensed under the MIT License., (*6)