protected function setInvoker($methodName, \closure $factory = null)
{
$invoker = parent::setInvoker($methodName, $factory);
$mock = $this->getMock();
if ($mock !== null) {
$invoker->setMock($this->getMock());
}
if ($this->autoBind === true) {
$invoker->bindTo($mock);
}
return $invoker;
}