- $processedText = text2clickable($text, '');
- $this->assertEquals($expectedText, $processedText);
- }
-
- /**
- * Test text2clickable with a redirector set.
- */
- public function testText2clickableWithRedirector()
- {
- $text = 'stuff http://hello.there/is=someone#here otherstuff';
- $redirector = 'http://redirector.to';
- $expectedText = 'stuff <a href="' .
- $redirector .
- urlencode('http://hello.there/is=someone#here') .
- '">http://hello.there/is=someone#here</a> otherstuff';
- $processedText = text2clickable($text, $redirector);
- $this->assertEquals($expectedText, $processedText);
- }
-
- /**
- * Test text2clickable a redirector set and without URL encode.
- */
- public function testText2clickableWithRedirectorDontEncode()
- {
- $text = 'stuff http://hello.there/?is=someone&or=something#here otherstuff';
- $redirector = 'http://redirector.to';
- $expectedText = 'stuff <a href="' .
- $redirector .
- 'http://hello.there/?is=someone&or=something#here' .
- '">http://hello.there/?is=someone&or=something#here</a> otherstuff';
- $processedText = text2clickable($text, $redirector, false);