public function enableLogging(string $filename, callable $callback = null) : self { $filename = trim($filename); // A log file has to be provided if (empty($filename)) { throw new \InvalidArgumentException('No log file was provided.'); } $this->logFile = $filename; $this->logCallback = $callback; return $this; }
/** * Tests registering a not callable function. */ public function testInvalidLogCallback() { $this->setExpectedException('\\InvalidArgumentException'); $this->rpc->enableLogging('file.log', 'dummy'); }