diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-08-31 21:39:09 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-08-31 21:39:09 +0200 |
commit | f008708d5cebfea7ef6efef4c876e99f819bff71 (patch) | |
tree | d8477ec9f19f5650dfb87c822904ccdccf251760 /tests/dbal/migrator_tool_module_test.php | |
parent | d737430a03dc9efa1633c13251fdb235540fdb3d (diff) | |
parent | 557f85e7fc3dc299859e846a8f406f0e19aaf465 (diff) | |
download | forums-f008708d5cebfea7ef6efef4c876e99f819bff71.tar forums-f008708d5cebfea7ef6efef4c876e99f819bff71.tar.gz forums-f008708d5cebfea7ef6efef4c876e99f819bff71.tar.bz2 forums-f008708d5cebfea7ef6efef4c876e99f819bff71.tar.xz forums-f008708d5cebfea7ef6efef4c876e99f819bff71.zip |
Merge pull request #4377 from rxu/ticket/14703
[ticket/14703] Fix parent module selection for custom extension modules
Diffstat (limited to 'tests/dbal/migrator_tool_module_test.php')
-rw-r--r-- | tests/dbal/migrator_tool_module_test.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php index 08c3e979b8..49dff8b929 100644 --- a/tests/dbal/migrator_tool_module_test.php +++ b/tests/dbal/migrator_tool_module_test.php @@ -118,6 +118,44 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case $this->fail($e); } $this->assertEquals(true, $this->tool->exists('acp', 'ACP_NEW_CAT', 'ACP_NEW_MODULE')); + + // Test adding module when plural parent module_langname exists + // PHPBB3-14703 + // Adding fail + try + { + $this->tool->add('acp', 'ACP_FORUM_BASED_PERMISSIONS', array( + 'module_basename' => 'acp_new_permissions_module', + 'module_langname' => 'ACP_NEW_PERMISSIONS_MODULE', + 'module_mode' => 'test', + 'module_auth' => '', + )); + $this->fail('Exception not thrown'); + } + catch (Exception $e) + { + $this->assertEquals('phpbb\db\migration\exception', get_class($e)); + $this->assertEquals('MODULE_EXIST_MULTIPLE', $e->getMessage()); + } + + // Test adding module when plural parent module_langname exists + // PHPBB3-14703 + // Adding success + try + { + $this->tool->add('acp', 'ACP_FORUM_BASED_PERMISSIONS', array( + 'module_basename' => 'acp_new_permissions_module', + 'module_langname' => 'ACP_NEW_PERMISSIONS_MODULE', + 'module_mode' => 'test', + 'module_auth' => '', + 'after' => 'ACP_FORUM_BASED_PERMISSIONS_CHILD_1', + )); + } + catch (Exception $e) + { + $this->fail($e); + } + $this->assertEquals(true, $this->tool->exists('acp', 'ACP_FORUM_BASED_PERMISSIONS', 'ACP_NEW_PERMISSIONS_MODULE')); } public function test_remove() |