orig_user = $user; $_SERVER['HTTP_HOST'] = $host; $_SERVER['REQUEST_URI'] = $script_uri; $user = $logged_on_as_user; $prefs['site_language'] = 'en'; } public function stopSimulatingTikiScriptContext() { global $tikilib, $user; unset($_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI']); $user = $this->orig_user; } /* * Like $tikilib->createPage(), except that it will delete the page if it already exists. */ public function createPage($name, $hits, $data, $lastModif = null, $comment = '', $user = 'admin', $ip = '0.0.0.0', $description = '', $lang = '', $is_html = false, $hash = null, $wysiwyg = null, $wiki_authors_style = '', $minor = 0, $created = '') { global $tikilib; if ($lastModif == null) { $lastModif = $tikilib->now; } if ($tikilib->page_exists($name)) { $tikilib->remove_all_versions($name); } $tikilib->create_page($name, $hits, $data, $lastModif, $comment, $user, $ip, $description, $lang, $is_html, $hash, $wysiwyg, $wiki_authors_style, $minor, $created); } public function removeAllVersions($page_name) { global $tikilib; $tikilib->remove_all_versions($page_name); } } $testhelpers = new TestHelpers();