function testErrorInParentCanBeCaught() { $this->sandbox->assignCallback('callbackWithError', function () { trigger_error('error in this callback', E_USER_ERROR); }); $res = $this->sandbox->execute(<<<CODE try { \$parent->callbackWithError('test'); } catch(\\Exception \$e) { return \$e->getMessage(); } CODE ); $this->assertEquals('error in this callback', $res); }
public function testChildCwdIsTheJail() { $res = $this->sandbox->execute('return file_get_contents("jailed.txt");'); $this->assertStringEqualsFile($this->jail . '/jailed.txt', $res); }