PHP code example of feedtailor / mocking-method-invoker

1. Go to this page and download the library: Download feedtailor/mocking-method-invoker library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

feedtailor / mocking-method-invoker example snippets


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.