Cascade\Tests\Config\Loader\ClassLoader\FormatterLoaderTest::doTestMethodCalledInHandler PHP Method

doTestMethodCalledInHandler() private method

Tests that calling the given Closure will trigger a method call with the given param in the given class
private doTestMethodCalledInHandler ( string $class, string $methodName, mixed $methodArg, Closure $closure )
$class string Class name
$methodName string Method name
$methodArg mixed Parameter passed to the closure
$closure Closure Closure to call
    private function doTestMethodCalledInHandler($class, $methodName, $methodArg, \Closure $closure)
    {
        // Setup mock and expectations
        $mock = $this->getMockBuilder($class)->setMethods(array($methodName))->getMock();
        $mock->expects($this->once())->method($methodName)->with($methodArg);
        // Calling the handler
        $closure($mock, $methodArg);
    }