summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2015-07-24 08:27:55 +0200
committerAndreas Gohr <andi@splitbrain.org>2015-07-24 08:27:55 +0200
commitdfbeea0341741e80e32e29f4ca832f79ac21b1d8 (patch)
tree54ae6d32d32d5c2b1c25d5b6b1853e8880542d40 /_test
parente9c4b8e690fdbc3d252801d772ce2d45309663b5 (diff)
parentac1654273a44452a833628e254ee3e172386a55e (diff)
downloadrpg-dfbeea0341741e80e32e29f4ca832f79ac21b1d8.tar.gz
rpg-dfbeea0341741e80e32e29f4ca832f79ac21b1d8.tar.bz2
Merge pull request #1247 from splitbrain/interwiki-fixes
Interwiki fixes
Diffstat (limited to '_test')
-rw-r--r--_test/tests/inc/parser/renderer_resolveinterwiki.test.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/_test/tests/inc/parser/renderer_resolveinterwiki.test.php b/_test/tests/inc/parser/renderer_resolveinterwiki.test.php
index dd1ed1d3f..772001b99 100644
--- a/_test/tests/inc/parser/renderer_resolveinterwiki.test.php
+++ b/_test/tests/inc/parser/renderer_resolveinterwiki.test.php
@@ -14,21 +14,23 @@ class Test_resolveInterwiki extends DokuWikiTest {
$Renderer->interwiki['withslash'] = '/test';
$Renderer->interwiki['onlytext'] = ':onlytext{NAME}'; //with {URL} double urlencoded
$Renderer->interwiki['withquery'] = ':anyns:{NAME}?do=edit';
+ //this was the only link with host/port/path/query. Keep it here for regression
+ $Renderer->interwiki['coral'] = 'http://{HOST}.{PORT}.nyud.net:8090{PATH}?{QUERY}';
$tests = array(
// shortcut, reference and expected
- array('wp', 'foo @+%/#txt', 'http://en.wikipedia.org/wiki/foo @+%/#txt'),
- array('amazon', 'foo @+%/#txt', 'http://www.amazon.com/exec/obidos/ASIN/foo%20%40%2B%25%2F/splitbrain-20/#txt'),
- array('doku', 'foo @+%/#txt', 'http://www.dokuwiki.org/foo%20%40%2B%25%2F#txt'),
- array('coral', 'http://example.com:83/path/naar/?query=foo%20%40%2B%25%2F', 'http://example.com.83.nyud.net:8090/path/naar/?query=foo%20%40%2B%25%2F'),
+ array('wp', 'foo [\\]^`{|}~@+#%?/#txt', 'https://en.wikipedia.org/wiki/foo %5B%5C%5D%5E%60%7B%7C%7D~@+%23%25?/#txt'),
+ array('amazon', 'foo [\\]^`{|}~@+#%?/#txt', 'https://www.amazon.com/exec/obidos/ASIN/foo%20%5B%5C%5D%5E%60%7B%7C%7D~%40%2B%23%25%3F%2F/splitbrain-20/#txt'),
+ array('doku', 'foo [\\]^`{|}~@+#%?/#txt', 'https://www.dokuwiki.org/foo%20%5B%5C%5D%5E%60%7B%7C%7D~%40%2B%23%25%3F%2F#txt'),
+ array('coral', 'http://example.com:83/path/naar/?query=foo%20%40%2B%25%3F%2F', 'http://example.com.83.nyud.net:8090/path/naar/?query=foo%20%40%2B%25%3F%2F'),
array('scheme', 'ftp://foo @+%/#txt', 'ftp://example.com#txt'),
//relative url
- array('withslash', 'foo @+%/#txt', '/testfoo%20%40%2B%25%2F#txt'),
- array('skype', 'foo @+%/#txt', 'skype:foo @+%/#txt'),
+ array('withslash', 'foo [\\]^`{|}~@+#%?/#txt', '/testfoo%20%5B%5C%5D%5E%60%7B%7C%7D~%40%2B%23%25%3F%2F#txt'),
+ array('skype', 'foo [\\]^`{|}~@+#%?/#txt', 'skype:foo %5B%5C%5D%5E%60%7B%7C%7D~@+%23%25?/#txt'),
//dokuwiki id's
- array('onlytext', 'foo @+%#txt', DOKU_BASE.'doku.php?id=onlytextfoo#txt'),
- array('user', 'foo @+%#txt', DOKU_BASE.'doku.php?id=user:foo#txt'),
- array('withquery', 'foo @+%#txt', DOKU_BASE.'doku.php?id=anyns:foo&amp;do=edit#txt')
+ array('onlytext', 'foo [\\]^`{|}~@+#%/#txt', DOKU_BASE.'doku.php?id=onlytextfoo#txt'),
+ array('user', 'foo [\\]^`{|}~@+#%/#txt', DOKU_BASE.'doku.php?id=user:foo#txt'),
+ array('withquery', 'foo [\\]^`{|}~@+#%/#txt', DOKU_BASE.'doku.php?id=anyns:foo&amp;do=edit#txt')
);
foreach($tests as $test) {
@@ -45,7 +47,7 @@ class Test_resolveInterwiki extends DokuWikiTest {
$shortcut = 'nonexisting';
$reference = 'foo @+%/';
$url = $Renderer->_resolveInterWiki($shortcut, $reference);
- $expected = 'http://www.google.com/search?q=foo%20%40%2B%25%2F&amp;btnI=lucky';
+ $expected = 'https://www.google.com/search?q=foo%20%40%2B%25%2F&amp;btnI=lucky';
$this->assertEquals($expected, $url);
}