public function registerFunc(string $func) : self { if (!function_exists($func)) { throw new \InvalidArgumentException(sprintf('Function %s does not exist.', $func)); } $this->register($func); return $this; }
/** * Tests registering a non-existent function. */ public function testRegisterNonExistingFunction() { $this->setExpectedException('\\InvalidArgumentException'); $this->rpc->registerFunc('dummy'); }