From 39e6decfeeb5519a78c960fd57d373496671a24b Mon Sep 17 00:00:00 2001
From: jan <jan@jandecaluwe.com>
Date: Thu, 20 Oct 2005 16:48:32 +0200
Subject: [PATCH] unit test for basedir/urlrewrite

darcs-hash:20051020144832-45605-937c1ffd5a474fa64c100937c421f39cae2402fd.gz
---
 _test/cases/inc/pageutils_getID.test.php | 27 ++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 _test/cases/inc/pageutils_getID.test.php

diff --git a/_test/cases/inc/pageutils_getID.test.php b/_test/cases/inc/pageutils_getID.test.php
new file mode 100644
index 000000000..33ff12c79
--- /dev/null
+++ b/_test/cases/inc/pageutils_getID.test.php
@@ -0,0 +1,27 @@
+<?php
+
+require_once DOKU_INC.'inc/pageutils.php';
+
+class init_getID_test extends UnitTestCase {
+
+    /**
+     * fetch media files with basedir and urlrewrite=2
+     * 
+     * data provided by Jan Decaluwe <jan@jandecaluwe.com>
+     */
+    function test1(){
+        global $conf;
+        $conf['basedir'] = '//';
+        $conf['urlrewrite'] = 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');
+    }
+
+
+}
+
-- 
GitLab