diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-11-07 20:23:58 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-11-07 20:23:58 +0100 |
commit | fd08b50a80c3aed25f9e2a19cbfe9fb3ad35cf1f (patch) | |
tree | ac75653241dec9fbdc0c66dfa14181b13d4a0dba /tests/LinkUtilsTest.php | |
parent | d12b2a08c886a652d1edbacb287788814a8ef7f1 (diff) | |
download | Shaarli-fd08b50a80c3aed25f9e2a19cbfe9fb3ad35cf1f.tar.gz Shaarli-fd08b50a80c3aed25f9e2a19cbfe9fb3ad35cf1f.tar.zst Shaarli-fd08b50a80c3aed25f9e2a19cbfe9fb3ad35cf1f.zip |
Don't URL encode description links if parameter 'redirector.encode_url' is set to false
Diffstat (limited to 'tests/LinkUtilsTest.php')
-rw-r--r-- | tests/LinkUtilsTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/LinkUtilsTest.php b/tests/LinkUtilsTest.php index c77922ec..99679320 100644 --- a/tests/LinkUtilsTest.php +++ b/tests/LinkUtilsTest.php | |||
@@ -131,6 +131,21 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase | |||
131 | } | 131 | } |
132 | 132 | ||
133 | /** | 133 | /** |
134 | * Test text2clickable a redirector set and without URL encode. | ||
135 | */ | ||
136 | public function testText2clickableWithRedirectorDontEncode() | ||
137 | { | ||
138 | $text = 'stuff http://hello.there/?is=someone&or=something#here otherstuff'; | ||
139 | $redirector = 'http://redirector.to'; | ||
140 | $expectedText = 'stuff <a href="'. | ||
141 | $redirector . | ||
142 | 'http://hello.there/?is=someone&or=something#here' . | ||
143 | '">http://hello.there/?is=someone&or=something#here</a> otherstuff'; | ||
144 | $processedText = text2clickable($text, $redirector, false); | ||
145 | $this->assertEquals($expectedText, $processedText); | ||
146 | } | ||
147 | |||
148 | /** | ||
134 | * Test testSpace2nbsp. | 149 | * Test testSpace2nbsp. |
135 | */ | 150 | */ |
136 | public function testSpace2nbsp() | 151 | public function testSpace2nbsp() |