feedtailor / mocking-method-invoker
Any methods invoker for Mock object.
0.1.0
2014-08-05 01:33 UTC
Requires
- php: >=5.3.3
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-12-17 08:31:51 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.