public function getName()
{
if (empty($this->name)) {
$r = null;
if (!preg_match('/(.*)\\\\Controller\\\\(.*)/i', get_class($this), $r)) {
throw new CannotGetName(\JText::_('LIB_FOF_CONTROLLER_ERR_GET_NAME'), 500);
}
$this->name = $r[2];
}
return $this->name;
}
/** * A mocked object will have a random name, that won't match the regex expression in the parent. * To prevent exceptions, we have to manually set the name * * @return string */ public function getName() { if (isset($this->mockedMethods['getName'])) { $func = $this->mockedMethods['getName']; return call_user_func_array($func, array()); } return parent::getName(); }