/** * Test whether sandbox custom exception handler intercepts exceptions */ public function testCustomExceptionHandler() { $this->setExpectedException('Exception'); $this->sandbox->whitelist_type('Exception'); $this->sandbox->set_exception_handler(function ($exception) { throw $exception; }); $this->sandbox->execute(function () { throw new \Exception(); }); }