aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkUtilsTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/LinkUtilsTest.php')
-rw-r--r--tests/LinkUtilsTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/LinkUtilsTest.php b/tests/LinkUtilsTest.php
index ef650f44..7fbd59b0 100644
--- a/tests/LinkUtilsTest.php
+++ b/tests/LinkUtilsTest.php
@@ -214,6 +214,16 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
214 $expectedText = 'stuff <a href="http://hello.there/is=someone#here">http://hello.there/is=someone#here</a> otherstuff'; 214 $expectedText = 'stuff <a href="http://hello.there/is=someone#here">http://hello.there/is=someone#here</a> otherstuff';
215 $processedText = text2clickable($text, ''); 215 $processedText = text2clickable($text, '');
216 $this->assertEquals($expectedText, $processedText); 216 $this->assertEquals($expectedText, $processedText);
217
218 $text = 'stuff http://hello.there/is=someone#here(please) otherstuff';
219 $expectedText = 'stuff <a href="http://hello.there/is=someone#here(please)">http://hello.there/is=someone#here(please)</a> otherstuff';
220 $processedText = text2clickable($text, '');
221 $this->assertEquals($expectedText, $processedText);
222
223 $text = 'stuff http://hello.there/is=someone#here(please)&no otherstuff';
224 $expectedText = 'stuff <a href="http://hello.there/is=someone#here(please)&no">http://hello.there/is=someone#here(please)&no</a> otherstuff';
225 $processedText = text2clickable($text, '');
226 $this->assertEquals($expectedText, $processedText);
217 } 227 }
218 228
219 /** 229 /**
@@ -232,6 +242,21 @@ class LinkUtilsTest extends PHPUnit_Framework_TestCase
232 } 242 }
233 243
234 /** 244 /**
245 * Test text2clickable a redirector set and without URL encode.
246 */
247 public function testText2clickableWithRedirectorDontEncode()
248 {
249 $text = 'stuff http://hello.there/?is=someone&or=something#here otherstuff';
250 $redirector = 'http://redirector.to';
251 $expectedText = 'stuff <a href="'.
252 $redirector .
253 'http://hello.there/?is=someone&or=something#here' .
254 '">http://hello.there/?is=someone&or=something#here</a> otherstuff';
255 $processedText = text2clickable($text, $redirector, false);
256 $this->assertEquals($expectedText, $processedText);
257 }
258
259 /**
235 * Test testSpace2nbsp. 260 * Test testSpace2nbsp.
236 */ 261 */
237 public function testSpace2nbsp() 262 public function testSpace2nbsp()