diff options
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r-- | tests/LinkDBTest.php | 23 |
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 | } |