]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/LinkFilterTest.php
lint: apply phpcbf to tests/
[github/shaarli/Shaarli.git] / tests / LinkFilterTest.php
index d796d3a301c469652bbb8bcc6295db0e539417cb..250046f84d0273b66e3d9b5a11b9d5b35f06979e 100644 (file)
@@ -7,6 +7,10 @@ require_once 'application/LinkFilter.php';
  */
 class LinkFilterTest extends PHPUnit_Framework_TestCase
 {
+    /**
+     * @var string Test datastore path.
+     */
+    protected static $testDatastore = 'sandbox/datastore.php';
     /**
      * @var LinkFilter instance.
      */
@@ -17,13 +21,20 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
      */
     protected static $refDB;
 
+    /**
+     * @var LinkDB instance
+     */
+    protected static $linkDB;
+
     /**
      * Instanciate linkFilter with ReferenceLinkDB data.
      */
     public static function setUpBeforeClass()
     {
         self::$refDB = new ReferenceLinkDB();
-        self::$linkFilter = new LinkFilter(self::$refDB->getLinks());
+        self::$refDB->write(self::$testDatastore);
+        self::$linkDB = new LinkDB(self::$testDatastore, true, false);
+        self::$linkFilter = new LinkFilter(self::$linkDB);
     }
 
     /**
@@ -286,7 +297,7 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
         $this->assertEquals(
             3,
             count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, '"free software"'))
-        );        
+        );
     }
 
     /**