From 15170b516429341ae8e1a9ad2111be5ef90bf6aa Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 2 Aug 2016 11:02:20 +0200 Subject: Parse plugin parameters description with the PluginManager Plugin parameter can contain a description in their meta file under the key: parameter.="" --- tests/PluginManagerTest.php | 10 ++++++++-- tests/config/ConfigPluginTest.php | 12 ++++++------ tests/plugins/test/test.meta | 4 +++- 3 files changed, 17 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/PluginManagerTest.php b/tests/PluginManagerTest.php index 61efce68..f4826e2e 100644 --- a/tests/PluginManagerTest.php +++ b/tests/PluginManagerTest.php @@ -79,8 +79,14 @@ class PluginManagerTest extends PHPUnit_Framework_TestCase $this->pluginManager->load(array(self::$pluginName)); $expectedParameters = array( - 'pop' => '', - 'hip' => '', + 'pop' => array( + 'value' => '', + 'desc' => 'pop description', + ), + 'hip' => array( + 'value' => '', + 'desc' => '', + ), ); $meta = $this->pluginManager->getPluginsMeta(); $this->assertEquals('test plugin', $meta[self::$pluginName]['description']); diff --git a/tests/config/ConfigPluginTest.php b/tests/config/ConfigPluginTest.php index 716631b0..3b37cd79 100644 --- a/tests/config/ConfigPluginTest.php +++ b/tests/config/ConfigPluginTest.php @@ -101,9 +101,9 @@ class ConfigPluginTest extends PHPUnit_Framework_TestCase $plugins = array( 'plugin_name' => array( 'parameters' => array( - 'param1' => true, - 'param2' => false, - 'param3' => '', + 'param1' => array('value' => true), + 'param2' => array('value' => false), + 'param3' => array('value' => ''), ) ) ); @@ -114,8 +114,8 @@ class ConfigPluginTest extends PHPUnit_Framework_TestCase ); $result = load_plugin_parameter_values($plugins, $parameters); - $this->assertEquals('value1', $result['plugin_name']['parameters']['param1']); - $this->assertEquals('value2', $result['plugin_name']['parameters']['param2']); - $this->assertEquals('', $result['plugin_name']['parameters']['param3']); + $this->assertEquals('value1', $result['plugin_name']['parameters']['param1']['value']); + $this->assertEquals('value2', $result['plugin_name']['parameters']['param2']['value']); + $this->assertEquals('', $result['plugin_name']['parameters']['param3']['value']); } } diff --git a/tests/plugins/test/test.meta b/tests/plugins/test/test.meta index ab999ed4..26f243f0 100644 --- a/tests/plugins/test/test.meta +++ b/tests/plugins/test/test.meta @@ -1,2 +1,4 @@ description="test plugin" -parameters="pop;hip" \ No newline at end of file +parameters="pop;hip" +parameter.pop="pop description" +parameter.hip= \ No newline at end of file -- cgit v1.2.3