From 07a7d227f78d5956f62a4164def7c68ca03019ee Mon Sep 17 00:00:00 2001 From: lisps Date: Fri, 22 Nov 2013 14:56:42 +0100 Subject: add test for empty rev in ml() and wl() --- _test/tests/inc/common_ml.test.php | 11 +++++++++++ _test/tests/inc/common_wl.test.php | 11 +++++++++++ 2 files changed, 22 insertions(+) (limited to '_test') diff --git a/_test/tests/inc/common_ml.test.php b/_test/tests/inc/common_ml.test.php index 415c0a88d..027dcaef2 100644 --- a/_test/tests/inc/common_ml.test.php +++ b/_test/tests/inc/common_ml.test.php @@ -146,4 +146,15 @@ class common_ml_test extends DokuWikiTest { $this->assertEquals($expect, ml($id, $args)); } + + function test_ml_empty_rev() { + global $conf; + $conf['useslash'] = 0; + $conf['userewrite'] = 0; + + $args = array('a' => 'b', 'c' => 'd', 'rev' => ''); + + $expect = DOKU_BASE . $this->script . '?a=b&c=d&media=some:img.jpg'; + $this->assertEquals($expect, ml('some:img.jpg', $args)); + } } diff --git a/_test/tests/inc/common_wl.test.php b/_test/tests/inc/common_wl.test.php index 2e34dcae3..4bfde3f39 100644 --- a/_test/tests/inc/common_wl.test.php +++ b/_test/tests/inc/common_wl.test.php @@ -142,6 +142,17 @@ class common_wl_test extends DokuWikiTest { $expect = DOKU_BASE . DOKU_SCRIPT . '/some/one?a=b&c=d'; $this->assertEquals($expect, wl('some:one', 'a=b,c=d', false, '&')); } + + function test_wl_empty_rev() { + global $conf; + $conf['useslash'] = 0; + $conf['userewrite'] = 0; + + $args = array('a' => 'b', 'c' => 'd', 'rev' => ''); + + $expect = DOKU_BASE . DOKU_SCRIPT . '?id=some:&a=b&c=d'; + $this->assertEquals($expect, wl('some:', $args)); + } -- cgit v1.2.3