public function setFuncValidator($callable) { $this->validation['function'] = $callable; return $this; }
/** * Test whether sandbox custom function validation succeeds */ public function testCustomFunctionValidationFailure() { $this->expectException('PHPSandbox\\Error'); $this->sandbox->setFuncValidator(function ($name) { return $name == 'test'; }); $this->sandbox->execute(function () { test2(); }); }