aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/api/controllers/info
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2021-01-20 15:59:00 +0100
committerArthurHoaro <arthur@hoa.ro>2021-02-04 11:02:50 +0100
commitbcba6bd353161fab456b423e93571ab027d5423c (patch)
tree97a618b77d327a5f963c91522988e24db5a9e158 /tests/api/controllers/info
parent8997ae6c8e24286f7d47981eaf905e80d2481c10 (diff)
downloadShaarli-bcba6bd353161fab456b423e93571ab027d5423c.tar.gz
Shaarli-bcba6bd353161fab456b423e93571ab027d5423c.tar.zst
Shaarli-bcba6bd353161fab456b423e93571ab027d5423c.zip
New plugin hook: ability to add custom filters to Shaarli search engine
A new plugin hook has been added: hook_test_filter_search_entry This hook allows to filter out bookmark with custom plugin code when a search is performed. Related to #143
Diffstat (limited to 'tests/api/controllers/info')
-rw-r--r--tests/api/controllers/info/InfoTest.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/api/controllers/info/InfoTest.php b/tests/api/controllers/info/InfoTest.php
index 10b29ab2..2428ca43 100644
--- a/tests/api/controllers/info/InfoTest.php
+++ b/tests/api/controllers/info/InfoTest.php
@@ -5,6 +5,7 @@ use malkusch\lock\mutex\NoMutex;
5use Shaarli\Bookmark\BookmarkFileService; 5use Shaarli\Bookmark\BookmarkFileService;
6use Shaarli\Config\ConfigManager; 6use Shaarli\Config\ConfigManager;
7use Shaarli\History; 7use Shaarli\History;
8use Shaarli\Plugin\PluginManager;
8use Shaarli\TestCase; 9use Shaarli\TestCase;
9use Slim\Container; 10use Slim\Container;
10use Slim\Http\Environment; 11use Slim\Http\Environment;
@@ -55,12 +56,18 @@ class InfoTest extends TestCase
55 $this->conf->set('resource.datastore', self::$testDatastore); 56 $this->conf->set('resource.datastore', self::$testDatastore);
56 $this->refDB = new \ReferenceLinkDB(); 57 $this->refDB = new \ReferenceLinkDB();
57 $this->refDB->write(self::$testDatastore); 58 $this->refDB->write(self::$testDatastore);
58 59 $this->pluginManager = new PluginManager($this->conf);
59 $history = new History('sandbox/history.php'); 60 $history = new History('sandbox/history.php');
60 61
61 $this->container = new Container(); 62 $this->container = new Container();
62 $this->container['conf'] = $this->conf; 63 $this->container['conf'] = $this->conf;
63 $this->container['db'] = new BookmarkFileService($this->conf, $history, $mutex, true); 64 $this->container['db'] = new BookmarkFileService(
65 $this->conf,
66 $this->pluginManager,
67 $history,
68 $mutex,
69 true
70 );
64 $this->container['history'] = null; 71 $this->container['history'] = null;
65 72
66 $this->controller = new Info($this->container); 73 $this->controller = new Info($this->container);