aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkDBTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r--tests/LinkDBTest.php25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php
index 8929713d..7b22b270 100644
--- a/tests/LinkDBTest.php
+++ b/tests/LinkDBTest.php
@@ -16,7 +16,7 @@ require_once 'tests/utils/ReferenceLinkDB.php';
16class LinkDBTest extends PHPUnit_Framework_TestCase 16class LinkDBTest extends PHPUnit_Framework_TestCase
17{ 17{
18 // datastore to test write operations 18 // datastore to test write operations
19 protected static $testDatastore = 'tests/datastore.php'; 19 protected static $testDatastore = 'sandbox/datastore.php';
20 protected static $refDB = null; 20 protected static $refDB = null;
21 protected static $publicLinkDB = null; 21 protected static $publicLinkDB = null;
22 protected static $privateLinkDB = null; 22 protected static $privateLinkDB = null;
@@ -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}