+ public function testPluginNotFound(): void
+ {
+ $this->pluginManager->load([]);
+ $this->pluginManager->load(['nope', 'renope']);
+ $this->addToAssertionCount(1);
+ }
+
+ /**
+ * Test plugin metadata loading.
+ */
+ public function testGetPluginsMeta(): void
+ {
+ PluginManager::$PLUGINS_PATH = self::$pluginPath;
+ $this->pluginManager->load([self::$pluginName]);
+
+ $expectedParameters = [
+ 'pop' => [
+ 'value' => '',
+ 'desc' => 'pop description',
+ ],
+ 'hip' => [
+ 'value' => '',
+ 'desc' => '',
+ ],
+ ];
+ $meta = $this->pluginManager->getPluginsMeta();
+ $this->assertEquals('test plugin', $meta[self::$pluginName]['description']);
+ $this->assertEquals($expectedParameters, $meta[self::$pluginName]['parameters']);
+ }
+
+ /**
+ * Test plugin custom routes - note that there is no check on callable functions
+ */
+ public function testRegisteredRoutes(): void
+ {
+ PluginManager::$PLUGINS_PATH = self::$pluginPath;
+ $this->pluginManager->load([self::$pluginName]);
+
+ $expectedParameters = [
+ [
+ 'method' => 'GET',
+ 'route' => '/test',
+ 'callable' => 'getFunction',
+ ],
+ [
+ 'method' => 'POST',
+ 'route' => '/custom',
+ 'callable' => 'postFunction',
+ ],
+ ];
+ $meta = $this->pluginManager->getRegisteredRoutes();
+ static::assertSame($expectedParameters, $meta[self::$pluginName]);
+ }
+
+ /**
+ * Test plugin custom routes with invalid route
+ */
+ public function testRegisteredRoutesInvalid(): void