s = $s; } function System() { return $this->s; } } eval('class CheckHarness { public $vars; function set($v) { $this->vars = $v; } '.$method.' }'); function attempt($u) { global $user; $user = $u; $h = new CheckHarness(); try { $h->daemonCheck('zmc'); } catch (UnauthorizedException $e) { return 'refused'; } return 'answered'; } check('System None is refused', attempt(new FakeUser('None')), 'refused'); check('System View is answered', attempt(new FakeUser('View')), 'answered'); check('System Edit is answered', attempt(new FakeUser('Edit')), 'answered'); check('auth off is answered', attempt(null), 'answered'); unlink("$bin/zmdc.pl"); rmdir($bin); exit($failures ? 1 : 0);