aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkDBTest.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2015-11-26 23:05:58 +0100
committerVirtualTam <virtualtam@flibidi.net>2015-11-26 23:05:58 +0100
commit61873e3ded8dfba397b39aebd2322d0939c82caa (patch)
treea0cb54fb7223f23faa67bd90349a0981b9ef04e6 /tests/LinkDBTest.php
parent657f0e25ba2c6f39775a8386b62d7c662ae709f7 (diff)
parent90e5bd65c9d4a5d3d5cedfeaa1314f2a15df5227 (diff)
downloadShaarli-61873e3ded8dfba397b39aebd2322d0939c82caa.tar.gz
Shaarli-61873e3ded8dfba397b39aebd2322d0939c82caa.tar.zst
Shaarli-61873e3ded8dfba397b39aebd2322d0939c82caa.zip
Merge pull request #355 from ArthurHoaro/redirector-url
URL encode links when a redirector is set
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r--tests/LinkDBTest.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php
index 8929713d..ff917f6d 100644
--- a/tests/LinkDBTest.php
+++ b/tests/LinkDBTest.php
@@ -511,4 +511,27 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
511 sizeof(self::$publicLinkDB->filterFullText('free software')) 511 sizeof(self::$publicLinkDB->filterFullText('free software'))
512 ); 512 );
513 } 513 }
514
515 /**
516 * Test real_url without redirector.
517 */
518 public function testLinkRealUrlWithoutRedirector()
519 {
520 $db = new LinkDB(self::$testDatastore, false, false);
521 foreach($db as $link) {
522 $this->assertEquals($link['url'], $link['real_url']);
523 }
524 }
525
526 /**
527 * Test real_url with redirector.
528 */
529 public function testLinkRealUrlWithRedirector()
530 {
531 $redirector = 'http://redirector.to?';
532 $db = new LinkDB(self::$testDatastore, false, false, $redirector);
533 foreach($db as $link) {
534 $this->assertStringStartsWith($redirector, $link['real_url']);
535 }
536 }
514} 537}