aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkFilterTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-10-28 12:44:44 +0200
committerGitHub <noreply@github.com>2017-10-28 12:44:44 +0200
commit0926d263902c184bd4f4c2036cb8ee90f81c5060 (patch)
treef326e180aee99881725e5e2abf5a4c13e323e964 /tests/LinkFilterTest.php
parent88d38cb290aad669ad1406e2362d85c81e46d4f6 (diff)
parent9ec0a61156192484ca90a8dc88b7c23b26129755 (diff)
downloadShaarli-0926d263902c184bd4f4c2036cb8ee90f81c5060.tar.gz
Shaarli-0926d263902c184bd4f4c2036cb8ee90f81c5060.tar.zst
Shaarli-0926d263902c184bd4f4c2036cb8ee90f81c5060.zip
Merge pull request #962 from ArthurHoaro/feature/perfs2
Performances: reorder links when they're written instead of read
Diffstat (limited to 'tests/LinkFilterTest.php')
-rw-r--r--tests/LinkFilterTest.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/LinkFilterTest.php b/tests/LinkFilterTest.php
index d796d3a3..9cd6dbd4 100644
--- a/tests/LinkFilterTest.php
+++ b/tests/LinkFilterTest.php
@@ -8,6 +8,10 @@ require_once 'application/LinkFilter.php';
8class LinkFilterTest extends PHPUnit_Framework_TestCase 8class LinkFilterTest extends PHPUnit_Framework_TestCase
9{ 9{
10 /** 10 /**
11 * @var string Test datastore path.
12 */
13 protected static $testDatastore = 'sandbox/datastore.php';
14 /**
11 * @var LinkFilter instance. 15 * @var LinkFilter instance.
12 */ 16 */
13 protected static $linkFilter; 17 protected static $linkFilter;
@@ -18,12 +22,19 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
18 protected static $refDB; 22 protected static $refDB;
19 23
20 /** 24 /**
25 * @var LinkDB instance
26 */
27 protected static $linkDB;
28
29 /**
21 * Instanciate linkFilter with ReferenceLinkDB data. 30 * Instanciate linkFilter with ReferenceLinkDB data.
22 */ 31 */
23 public static function setUpBeforeClass() 32 public static function setUpBeforeClass()
24 { 33 {
25 self::$refDB = new ReferenceLinkDB(); 34 self::$refDB = new ReferenceLinkDB();
26 self::$linkFilter = new LinkFilter(self::$refDB->getLinks()); 35 self::$refDB->write(self::$testDatastore);
36 self::$linkDB = new LinkDB(self::$testDatastore, true, false);
37 self::$linkFilter = new LinkFilter(self::$linkDB);
27 } 38 }
28 39
29 /** 40 /**