/** * Test whether sandbox custom validation error handler intercepts validation Errors */ public function testCustomValidationErrorHandler() { $this->setExpectedException('PHPSandbox\\Error'); $this->sandbox->set_validation_error_handler(function ($error) { throw $error; }); $this->sandbox->execute(function () { test2(); }); }