X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FLinkDBTest.php;h=9c64188f53de3f5632e36bd3a1af8c462306afeb;hb=649af5b501d2a90448242f53764ff693e9854039;hp=52d31400b5a0716ebce5c2ab51ec3ab008af4c38;hpb=11609d9fd8ba53f049e6c913d8e3affab6cfc9ce;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php index 52d31400..9c64188f 100644 --- a/tests/LinkDBTest.php +++ b/tests/LinkDBTest.php @@ -101,7 +101,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase * Attempt to instantiate a LinkDB whereas the datastore is not writable * * @expectedException IOException - * @expectedExceptionMessageRegExp /Error accessing null/ + * @expectedExceptionMessageRegExp /Error accessing\nnull/ */ public function testConstructDatastoreNotWriteable() { @@ -290,7 +290,9 @@ class LinkDBTest extends PHPUnit_Framework_TestCase 'stallman' => 1, 'free' => 1, '-exclude' => 1, - 'stuff' => 2, + // The DB contains a link with `sTuff` and another one with `stuff` tag. + // They need to be grouped with the first case found (`sTuff`). + 'sTuff' => 2, ), self::$publicLinkDB->allTags() ); @@ -310,7 +312,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase 'w3c' => 1, 'css' => 1, 'Mercurial' => 1, - 'stuff' => 2, + 'sTuff' => 2, '-exclude' => 1, '.hidden' => 1, ), @@ -338,6 +340,13 @@ class LinkDBTest extends PHPUnit_Framework_TestCase $db = new LinkDB(self::$testDatastore, false, false, $redirector); foreach($db as $link) { $this->assertStringStartsWith($redirector, $link['real_url']); + $this->assertNotFalse(strpos($link['real_url'], urlencode('://'))); + } + + $db = new LinkDB(self::$testDatastore, false, false, $redirector, false); + foreach($db as $link) { + $this->assertStringStartsWith($redirector, $link['real_url']); + $this->assertFalse(strpos($link['real_url'], urlencode('://'))); } }