X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fbookmark%2FLinkUtilsTest.php;h=bd08f03670a68cba16bea8895a906b35c5b953ec;hb=015314f3c6a1ce0b2c45fdb2fb0d36a15cab10f5;hp=1b8688e6d398fc1381e6b2acc586ae2562c282f2;hpb=ff3b5dc5542ec150f0d9b447394364a15e9156d0;p=github%2Fshaarli%2FShaarli.git
diff --git a/tests/bookmark/LinkUtilsTest.php b/tests/bookmark/LinkUtilsTest.php
index 1b8688e6..bd08f036 100644
--- a/tests/bookmark/LinkUtilsTest.php
+++ b/tests/bookmark/LinkUtilsTest.php
@@ -216,56 +216,27 @@ class LinkUtilsTest extends \PHPUnit\Framework\TestCase
}
/**
- * Test text2clickable without a redirector being set.
+ * Test text2clickable.
*/
- public function testText2clickableWithoutRedirector()
+ public function testText2clickable()
{
$text = 'stuff http://hello.there/is=someone#here otherstuff';
$expectedText = 'stuff '
. 'http://hello.there/is=someone#here otherstuff';
- $processedText = text2clickable($text, '');
+ $processedText = text2clickable($text);
$this->assertEquals($expectedText, $processedText);
$text = 'stuff http://hello.there/is=someone#here(please) otherstuff';
$expectedText = 'stuff '
. 'http://hello.there/is=someone#here(please) otherstuff';
- $processedText = text2clickable($text, '');
+ $processedText = text2clickable($text);
$this->assertEquals($expectedText, $processedText);
+ $text = 'stuff http://hello.there/is=someone#here(please)&no otherstuff';
$text = 'stuff http://hello.there/is=someone#here(please)&no otherstuff';
$expectedText = 'stuff '
. 'http://hello.there/is=someone#here(please)&no otherstuff';
- $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 http://hello.there/is=someone#here 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 http://hello.there/?is=someone&or=something#here otherstuff';
- $processedText = text2clickable($text, $redirector, false);
+ $processedText = text2clickable($text);
$this->assertEquals($expectedText, $processedText);
}