aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extension/modules_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-05-12 22:21:16 +0200
committerMarc Alexander <admin@m-a-styles.de>2013-05-12 22:24:50 +0200
commitf90ed6c3cb9e1b8baeb352a07b81608fa7c067b5 (patch)
tree1c9494fd1ab82e4f0017527e8a456ccb6ea3738f /tests/extension/modules_test.php
parent7327f9326f739f9b602fd8896e8a4731caa93ee8 (diff)
downloadforums-f90ed6c3cb9e1b8baeb352a07b81608fa7c067b5.tar
forums-f90ed6c3cb9e1b8baeb352a07b81608fa7c067b5.tar.gz
forums-f90ed6c3cb9e1b8baeb352a07b81608fa7c067b5.tar.bz2
forums-f90ed6c3cb9e1b8baeb352a07b81608fa7c067b5.tar.xz
forums-f90ed6c3cb9e1b8baeb352a07b81608fa7c067b5.zip
[ticket/11465] Add disabled ext to allow proper testing of get_module_infos()
This will now also enable us to test the $use_all_available parameter of get_module_infos(), which will not only return the module infos for enabled extensions but also those from disabled extensions. PHPBB3-11465
Diffstat (limited to 'tests/extension/modules_test.php')
-rw-r--r--tests/extension/modules_test.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/extension/modules_test.php b/tests/extension/modules_test.php
index d24a3ec52f..fe71747c5d 100644
--- a/tests/extension/modules_test.php
+++ b/tests/extension/modules_test.php
@@ -10,6 +10,7 @@
require_once dirname(__FILE__) . '/ext/foo/acp/a_info.php';
require_once dirname(__FILE__) . '/ext/foo/mcp/a_info.php';
require_once dirname(__FILE__) . '/ext/foo/acp/fail_info.php';
+require_once dirname(__FILE__) . '/ext/barfoo/acp/a_info.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/acp/acp_modules.php';
class phpbb_extension_modules_test extends phpbb_test_case
@@ -145,7 +146,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
$this->assertEquals(array(), $acp_modules);
// No specific module, module class set to false (will default to the above acp)
- // Setting $use_all_available will have no effect here as the ext manager is just mocked
+ // Setting $use_all_available will cause get_module_infos() to also load not enabled extensions (barfoo)
$this->acp_modules->module_class = 'acp';
$acp_modules = $this->acp_modules->get_module_infos('', false, true);
$this->assertEquals(array(
@@ -165,6 +166,27 @@ class phpbb_extension_modules_test extends phpbb_test_case
'test' => array('title' => 'Test', 'auth' => '', 'cat' => array('ACP_GENERAL')),
),
),
+ 'phpbb_ext_barfoo_acp_a_module' => array(
+ 'filename' => 'phpbb_ext_barfoo_acp_a_module',
+ 'title' => 'Barfoo',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')),
+ ),
+ )
+ ), $acp_modules);
+
+ // Specific module set to disabled extension
+ $acp_modules = $this->acp_modules->get_module_infos('phpbb_ext_barfoo_acp_a_module', 'acp', true);
+ $this->assertEquals(array(
+ 'phpbb_ext_barfoo_acp_a_module' => array(
+ 'filename' => 'phpbb_ext_barfoo_acp_a_module',
+ 'title' => 'Barfoo',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')),
+ ),
+ )
), $acp_modules);
}
}