diff options
author | Andreas Gohr <andi@splitbrain.org> | 2005-10-21 23:23:04 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2005-10-21 23:23:04 +0200 |
commit | 42905504e134d999710eacf73253844e85cf6fec (patch) | |
tree | adc7d8e56058fb2b5c2b8ec45eb758a4bf701495 /_test | |
parent | bc228f156741b7e3e76517034e52463eb7d73fc2 (diff) | |
download | rpg-42905504e134d999710eacf73253844e85cf6fec.tar.gz rpg-42905504e134d999710eacf73253844e85cf6fec.tar.bz2 |
some fixes for getID and the detail page
darcs-hash:20051021212304-7ad00-f01b3954b6b71ecc9e0cf899ed62bfb33e0c437e.gz
Diffstat (limited to '_test')
-rw-r--r-- | _test/cases/inc/pageutils_getID.test.php | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/_test/cases/inc/pageutils_getID.test.php b/_test/cases/inc/pageutils_getID.test.php index 33ff12c79..e6ddb5e3b 100644 --- a/_test/cases/inc/pageutils_getID.test.php +++ b/_test/cases/inc/pageutils_getID.test.php @@ -12,16 +12,38 @@ class init_getID_test extends UnitTestCase { function test1(){ global $conf; $conf['basedir'] = '//'; - $conf['urlrewrite'] = 2; + $conf['userewrite'] = 2; $conf['deaccent'] = 0; // the default (1) gives me strange exceptions $_SERVER['SCRIPT_FILENAME'] = '/lib/exe/fetch.php'; $_SERVER['REQUEST_URI'] = '/lib/exe/fetch.php/myhdl-0.5dev1.tar.gz?id=snapshots&cache=cache'; - $this->assertEqual(getID($param='not_id'), 'myhdl-0.5dev1.tar.gz'); + $this->assertEqual(getID('media'), 'myhdl-0.5dev1.tar.gz'); } -} + /** + * getID with internal mediafile, urlrewrite=2, no basedir set, apache, mod_php + */ + function test2(){ + global $conf; + $conf['basedir'] = ''; + $conf['userewrite'] = '2'; + $conf['baseurl'] = ''; + $conf['useslash'] = '1'; + $_SERVER['DOCUMENT_ROOT'] = '/var/www/'; + $_SERVER['HTTP_HOST'] = 'xerxes.my.home'; + $_SERVER['SCRIPT_FILENAME'] = '/var/www/dokuwiki/lib/exe/detail.php'; + $_SERVER['PHP_SELF'] = '/dokuwiki/lib/exe/detail.php/wiki/discussion/button-dw.png'; + $_SERVER['REQUEST_URI'] = '/dokuwiki/lib/exe/detail.php/wiki/discussion/button-dw.png?id=test&debug=1'; + $_SERVER['SCRIPT_NAME'] = '/dokuwiki/lib/exe/detail.php'; + $_SERVER['PATH_INFO'] = '/wiki/discussion/button-dw.png'; + $_SERVER['PATH_TRANSLATED'] = '/var/www/wiki/discussion/button-dw.png'; + + $this->assertEqual(getID('media',true), 'wiki:discussion:button-dw.png'); + $this->assertEqual(getID('media',false), 'wiki/discussion/button-dw.png'); + } +} +//Setup VIM: ex: et ts=4 enc=utf-8 : |