aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/extension/ext/foo/acp/fail_info.php5
-rw-r--r--tests/extension/ext/foo/acp/fail_module.php5
-rw-r--r--tests/extension/modules_test.php5
3 files changed, 13 insertions, 2 deletions
diff --git a/tests/extension/ext/foo/acp/fail_info.php b/tests/extension/ext/foo/acp/fail_info.php
index 98b0eb9529..99aa09551e 100644
--- a/tests/extension/ext/foo/acp/fail_info.php
+++ b/tests/extension/ext/foo/acp/fail_info.php
@@ -1,5 +1,8 @@
<?php
-
+/*
+* Due to the mismatch between the class name and the file name, this module
+* file shouldn't be found by the extension finder
+*/
class phpbb_ext_foo_acp_foo_info
{
public function module()
diff --git a/tests/extension/ext/foo/acp/fail_module.php b/tests/extension/ext/foo/acp/fail_module.php
index dd16955418..a200d92d2f 100644
--- a/tests/extension/ext/foo/acp/fail_module.php
+++ b/tests/extension/ext/foo/acp/fail_module.php
@@ -1,5 +1,8 @@
<?php
-
+/*
+* Due to the mismatch between the class name and the file name of the module
+* info file, this module's info file shouldn't be found
+*/
class phpbb_ext_foo_acp_fail_module
{
}
diff --git a/tests/extension/modules_test.php b/tests/extension/modules_test.php
index 675fb1f4a0..f0acd6f2eb 100644
--- a/tests/extension/modules_test.php
+++ b/tests/extension/modules_test.php
@@ -47,6 +47,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
// Correctly set the root path for this test to this directory, so the classes can be found
$phpbb_root_path = dirname(__FILE__) . '/';
+ // Find acp module info files
$this->acp_modules->module_class = 'acp';
$acp_modules = $this->acp_modules->get_module_infos();
$this->assertEquals(array(
@@ -68,6 +69,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
),
), $acp_modules);
+ // Find mcp module info files
$this->acp_modules->module_class = 'mcp';
$acp_modules = $this->acp_modules->get_module_infos();
$this->assertEquals(array(
@@ -81,6 +83,7 @@ class phpbb_extension_modules_test extends phpbb_test_case
),
), $acp_modules);
+ // Find a specific module info file (mcp_a_module)
$this->acp_modules->module_class = 'mcp';
$acp_modules = $this->acp_modules->get_module_infos('mcp_a_module');
$this->assertEquals(array(
@@ -94,10 +97,12 @@ class phpbb_extension_modules_test extends phpbb_test_case
),
), $acp_modules);
+ // The mcp module info file we're looking for shouldn't exist
$this->acp_modules->module_class = 'mcp';
$acp_modules = $this->acp_modules->get_module_infos('mcp_a_fail');
$this->assertEquals(array(), $acp_modules);
+ // As there are no ucp modules we shouldn't find any
$this->acp_modules->module_class = 'ucp';
$acp_modules = $this->acp_modules->get_module_infos();
$this->assertEquals(array(), $acp_modules);