id = $id; } public function Id() { return $this->id; } public function canView() { return in_array($this->id, self::$viewable); } } } namespace { $root = isset($argv[1]) ? $argv[1] : __DIR__.'/../../web'; $file = $root.'/skins/classic/views/frames.php'; $stubdir = sys_get_temp_dir().'/zm_frames_view_stubs_'.getmypid(); @mkdir($stubdir.'/includes', 0700, true); file_put_contents($stubdir.'/includes/Frame.php', " '5')), 'frames'); check('missing event gets the error view', run($file, array('eid' => '999')), 'error'); $warnings = 0; check('missing eid gets the error view', run($file, array()), 'error'); check('missing eid raises no warning', $warnings, 0); echo $failures ? "\n$failures check(s) FAILED\n" : "\nall checks passed\n"; exit($failures ? 1 : 0); }