public function testCustomValidationErrorHandler() { $this->expectException('PHPSandbox\\Error'); $this->sandbox->setValidationErrorHandler(function ($error) { throw $error; }); $this->sandbox->execute(function () { test2(); }); }