aboutsummaryrefslogtreecommitdiffstats
path: root/tests/extension/ext
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-03-22 10:12:39 +0100
committerMarc Alexander <admin@m-a-styles.de>2013-03-22 10:26:01 +0100
commitfadcee77b9ac652655f1dffb07979ac59b78b140 (patch)
tree0a639d16fb1521f480b0b7f2e774d5c46384055d /tests/extension/ext
parentaefca4b40f67bc4d0cc52c8f89705148237a5f05 (diff)
downloadforums-fadcee77b9ac652655f1dffb07979ac59b78b140.tar
forums-fadcee77b9ac652655f1dffb07979ac59b78b140.tar.gz
forums-fadcee77b9ac652655f1dffb07979ac59b78b140.tar.bz2
forums-fadcee77b9ac652655f1dffb07979ac59b78b140.tar.xz
forums-fadcee77b9ac652655f1dffb07979ac59b78b140.zip
[ticket/11465] Add unit tests for acp_modules::get_module_infos()
The tests add 3 different modules. One acp module that should be found (acp/a_module), one acp module that should not be found (acp/fail_module), and one mcp module that should work again (mcp/a_module). The modules' info files had to be included as they were not auto-loaded for some reason. There are several test stages. First of, it is tested if the correct mcp and acp module is returned. Afterwards, the proper loading of specified modules is tested. One with an existing module and one with a not existing module. Finally, the test concludes with trying to get the module info of not existing ucp modules. Other classes like foobar would have also worked for that check but I decided to use the ucp type of class as that is the one type missing from the added test modules. PHPBB3-11465
Diffstat (limited to 'tests/extension/ext')
-rw-r--r--tests/extension/ext/foo/acp/a_info.php16
-rw-r--r--tests/extension/ext/foo/acp/a_module.php5
-rw-r--r--tests/extension/ext/foo/acp/fail_info.php16
-rw-r--r--tests/extension/ext/foo/acp/fail_module.php5
-rw-r--r--tests/extension/ext/foo/mcp/a_info.php16
-rw-r--r--tests/extension/ext/foo/mcp/a_module.php5
6 files changed, 63 insertions, 0 deletions
diff --git a/tests/extension/ext/foo/acp/a_info.php b/tests/extension/ext/foo/acp/a_info.php
new file mode 100644
index 0000000000..3e9bbffaca
--- /dev/null
+++ b/tests/extension/ext/foo/acp/a_info.php
@@ -0,0 +1,16 @@
+<?php
+
+class phpbb_ext_foo_acp_a_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => 'phpbb_ext_foo_acp_a_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')),
+ ),
+ );
+ }
+}
diff --git a/tests/extension/ext/foo/acp/a_module.php b/tests/extension/ext/foo/acp/a_module.php
new file mode 100644
index 0000000000..093b4b1ad7
--- /dev/null
+++ b/tests/extension/ext/foo/acp/a_module.php
@@ -0,0 +1,5 @@
+<?php
+
+class phpbb_ext_foo_acp_a_module
+{
+}
diff --git a/tests/extension/ext/foo/acp/fail_info.php b/tests/extension/ext/foo/acp/fail_info.php
new file mode 100644
index 0000000000..98b0eb9529
--- /dev/null
+++ b/tests/extension/ext/foo/acp/fail_info.php
@@ -0,0 +1,16 @@
+<?php
+
+class phpbb_ext_foo_acp_foo_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => 'phpbb_ext_foo_acp_fail_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('ACP_MODS')),
+ ),
+ );
+ }
+}
diff --git a/tests/extension/ext/foo/acp/fail_module.php b/tests/extension/ext/foo/acp/fail_module.php
new file mode 100644
index 0000000000..dd16955418
--- /dev/null
+++ b/tests/extension/ext/foo/acp/fail_module.php
@@ -0,0 +1,5 @@
+<?php
+
+class phpbb_ext_foo_acp_fail_module
+{
+}
diff --git a/tests/extension/ext/foo/mcp/a_info.php b/tests/extension/ext/foo/mcp/a_info.php
new file mode 100644
index 0000000000..84a36b9134
--- /dev/null
+++ b/tests/extension/ext/foo/mcp/a_info.php
@@ -0,0 +1,16 @@
+<?php
+
+class phpbb_ext_foo_mcp_a_info
+{
+ public function module()
+ {
+ return array(
+ 'filename' => 'phpbb_ext_foo_mcp_a_module',
+ 'title' => 'Foobar',
+ 'version' => '3.1.0-dev',
+ 'modes' => array(
+ 'config' => array('title' => 'Config', 'auth' => '', 'cat' => array('MCP_MAIN')),
+ ),
+ );
+ }
+}
diff --git a/tests/extension/ext/foo/mcp/a_module.php b/tests/extension/ext/foo/mcp/a_module.php
new file mode 100644
index 0000000000..59d9f8cc6f
--- /dev/null
+++ b/tests/extension/ext/foo/mcp/a_module.php
@@ -0,0 +1,5 @@
+<?php
+
+class phpbb_ext_foo_mcp_a_module
+{
+}