X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fbookmark%2FLinkUtilsTest.php;h=25fb30435c8ef09c91623f6b416c1b6300ff459e;hb=cc69aad4a903dc603f47cfa87aeb1865b03c8950;hp=5b31115bf50aa570937c62123922205fda1b7950;hpb=a8e7da01146455f13ef06b151a7dafedd3acf769;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/bookmark/LinkUtilsTest.php b/tests/bookmark/LinkUtilsTest.php index 5b31115b..25fb3043 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); }