aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PluginManagerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/PluginManagerTest.php')
-rw-r--r--tests/PluginManagerTest.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/PluginManagerTest.php b/tests/PluginManagerTest.php
index 8947f679..75b3ae00 100644
--- a/tests/PluginManagerTest.php
+++ b/tests/PluginManagerTest.php
@@ -2,6 +2,7 @@
2 2
3namespace Shaarli\Plugin; 3namespace Shaarli\Plugin;
4 4
5use Shaarli\Bookmark\Bookmark;
5use Shaarli\Config\ConfigManager; 6use Shaarli\Config\ConfigManager;
6 7
7/** 8/**
@@ -159,4 +160,19 @@ class PluginManagerTest extends \Shaarli\TestCase
159 $errors = $this->pluginManager->getErrors(); 160 $errors = $this->pluginManager->getErrors();
160 static::assertSame(['test_route_invalid [plugin incompatibility]: trying to register invalid route.'], $errors); 161 static::assertSame(['test_route_invalid [plugin incompatibility]: trying to register invalid route.'], $errors);
161 } 162 }
163
164 public function testSearchFilterPlugin(): void
165 {
166 PluginManager::$PLUGINS_PATH = self::$pluginPath;
167 $this->pluginManager->load([self::$pluginName]);
168
169 static::assertNull($this->pluginManager->getFilterSearchEntryHooks());
170
171 static::assertTrue($this->pluginManager->filterSearchEntry(new Bookmark(), ['_result' => true]));
172
173 static::assertCount(1, $this->pluginManager->getFilterSearchEntryHooks());
174 static::assertSame('hook_test_filter_search_entry', $this->pluginManager->getFilterSearchEntryHooks()[0]);
175
176 static::assertFalse($this->pluginManager->filterSearchEntry(new Bookmark(), ['_result' => false]));
177 }
162} 178}