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);
}