feedtailor / mocking-method-invoker
Any methods invoker for Mock object.
Installs: 126
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 0
Open Issues: 0
pkg:composer/feedtailor/mocking-method-invoker
Requires
- php: >=5.3.3
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2025-10-21 12:42:15 UTC
README
Any methods invoker for Mock object.
Install
Add feedtailor/mocking-method-invoker as a dependency in your project's composer.json file.
{
"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.
$invoker->invoke($name, $args);
invoke the $name method with $args array arguments.
License
Licensed under the MIT License.