aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal/migrator_tool_module_test.php
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2016-10-23 23:33:03 +0700
committerrxu <rxu@mail.ru>2016-10-23 23:33:03 +0700
commit849cd74700bc1425245ae9a8c5ec5f126d7a61ff (patch)
treec1ace01c8d1c31d16abf53fbea7e7b8520ce45f5 /tests/dbal/migrator_tool_module_test.php
parent51ef1ae346c08863d188e723ba41720e744a2fbd (diff)
downloadforums-849cd74700bc1425245ae9a8c5ec5f126d7a61ff.tar
forums-849cd74700bc1425245ae9a8c5ec5f126d7a61ff.tar.gz
forums-849cd74700bc1425245ae9a8c5ec5f126d7a61ff.tar.bz2
forums-849cd74700bc1425245ae9a8c5ec5f126d7a61ff.tar.xz
forums-849cd74700bc1425245ae9a8c5ec5f126d7a61ff.zip
[ticket/14831] Add more tests against UCP modules
PHPBB3-14831
Diffstat (limited to 'tests/dbal/migrator_tool_module_test.php')
-rw-r--r--tests/dbal/migrator_tool_module_test.php61
1 files changed, 60 insertions, 1 deletions
diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php
index 462b521f1a..bbe543f347 100644
--- a/tests/dbal/migrator_tool_module_test.php
+++ b/tests/dbal/migrator_tool_module_test.php
@@ -91,11 +91,70 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
/**
* @dataProvider exists_data_acp
*/
- public function test_exists($parent, $module, $expected)
+ public function test_exists_acp($parent, $module, $expected)
{
$this->assertEquals($expected, $this->tool->exists('acp', $parent, $module));
}
+ public function exists_data_ucp()
+ {
+ return array(
+ // Test the existing category
+ array(
+ '',
+ 'UCP_MAIN_CAT',
+ true,
+ ),
+ array(
+ 0,
+ 'UCP_MAIN_CAT',
+ true,
+ ),
+
+ // Test the existing module
+ array(
+ '',
+ 'UCP_SUBCATEGORY',
+ false,
+ ),
+ array(
+ false,
+ 'UCP_SUBCATEGORY',
+ true,
+ ),
+ array(
+ 'UCP_MAIN_CAT',
+ 'UCP_SUBCATEGORY',
+ true,
+ ),
+ array(
+ 'UCP_SUBCATEGORY',
+ 'UCP_MODULE',
+ true,
+ ),
+
+ // Test for non-existant modules
+ array(
+ '',
+ 'UCP_NON_EXISTANT_CAT',
+ false,
+ ),
+ array(
+ 'UCP_MAIN_CAT',
+ 'UCP_NON_EXISTANT_MODULE',
+ false,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider exists_data_ucp
+ */
+ public function test_exists_ucp($parent, $module, $expected)
+ {
+ $this->assertEquals($expected, $this->tool->exists('ucp', $parent, $module));
+ }
+
public function test_add()
{
try