From 528a6f8a232c060faf024008e4f8a09b4aa8dabc Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Mon, 21 Mar 2016 21:40:49 +0100 Subject: Refactor filter in LinkDB * search type now carried by LinkDB in order to factorize code between different search sources. * LinkDB->filter split in 3 method: filterSearch, filterHash, filterDay (we know what type of filter is needed). * filterHash now throw a LinkNotFoundException if it doesn't exist: internal implementation choice, still displays a 404. * Smallhash regex has been rewritten. * Unit tests update --- tests/Updater/UpdaterTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/Updater') diff --git a/tests/Updater/UpdaterTest.php b/tests/Updater/UpdaterTest.php index d865066b..a29d9067 100644 --- a/tests/Updater/UpdaterTest.php +++ b/tests/Updater/UpdaterTest.php @@ -236,9 +236,9 @@ class UpdaterTest extends PHPUnit_Framework_TestCase $refDB = new ReferenceLinkDB(); $refDB->write(self::$testDatastore); $linkDB = new LinkDB(self::$testDatastore, true, false); - $this->assertEmpty($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude')); + $this->assertEmpty($linkDB->filterSearch(array('searchtags' => 'exclude'))); $updater = new Updater(array(), self::$configFields, $linkDB, true); $updater->updateMethodRenameDashTags(); - $this->assertNotEmpty($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude')); + $this->assertNotEmpty($linkDB->filterSearch(array('searchtags' => 'exclude'))); } } -- cgit v1.2.3