From f8369d7d6e37248d6523fdac6e1d760fca4f1b52 Mon Sep 17 00:00:00 2001 From: Tobias Sarnowski Date: Wed, 18 Apr 2012 12:08:28 +0200 Subject: moved _testing to _test --- _test/bootstrap.php | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 _test/bootstrap.php (limited to '_test/bootstrap.php') diff --git a/_test/bootstrap.php b/_test/bootstrap.php new file mode 100644 index 000000000..f8ca4d483 --- /dev/null +++ b/_test/bootstrap.php @@ -0,0 +1,102 @@ + '?id=', + 'REQUEST_METHOD' => 'GET', + 'CONTENT_TYPE' => '', + 'CONTENT_LENGTH' => '', + 'SCRIPT_NAME' => '/doku.php', + 'REQUEST_URI' => '/doku.php?id=', + 'DOCUMENT_URI' => '/doku.php', + 'DOCUMENT_ROOT' => DOKU_INC, + 'SERVER_PROTOCOL' => 'HTTP/1.1', + 'SERVER_SOFTWARE' => 'nginx/0.7.67', + 'REMOTE_ADDR' => '87.142.120.6', + 'REMOTE_PORT' => '21418', + 'SERVER_ADDR' => '46.38.241.24', + 'SERVER_PORT' => '443', + 'SERVER_NAME' => 'wiki.example.com', + 'REDIRECT_STATUS' => '200', + 'SCRIPT_FILENAME' => DOKU_INC.'doku.php', + 'HTTP_HOST' => 'wiki.example.com', + 'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; OpenBSD amd64; rv:11.0) Gecko/20100101 Firefox/11.0', + 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', + 'HTTP_ACCEPT_LANGUAGE' => 'en-us,en;q=0.5', + 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate', + 'HTTP_CONNECTION' => 'keep-alive', + 'HTTP_CACHE_CONTROL' => 'max-age=0', + 'PHP_SELF' => '/doku.php', + 'REQUEST_TIME' => time(), +); + +// create temp directories +mkdir(TMP_DIR); + +// cleanup dir after exit +register_shutdown_function(function() { + TestUtils::rdelete(TMP_DIR); +}); + +// populate default dirs +TestUtils::rcopy(TMP_DIR, dirname(__FILE__).'/conf'); +TestUtils::rcopy(TMP_DIR, dirname(__FILE__).'/data'); + +// disable all non-default plugins by default +$dh = dir(DOKU_INC.'lib/plugins/'); +while (false !== ($entry = $dh->read())) { + if ($entry == '.' || $entry == '..') { + continue; + } + + if (!is_dir(DOKU_INC.'lib/plugins/'.$entry)) { + continue; + } + + if (!in_array($entry, $default_plugins)) { + // disable this plugin + TestUtils::fappend(DOKU_CONF.'plugins.local.php', "\$plugins['$entry'] = 0;\n"); + } +} +$dh->close(); + +// load dw +require_once(DOKU_INC.'inc/init.php'); + -- cgit v1.2.3