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