aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/extension_permission_lang_test.php
diff options
context:
space:
mode:
authorOpenShift guest <dachebodt@gmail.com>2013-04-13 11:24:47 -0400
committerOpenShift guest <dachebodt@gmail.com>2013-04-13 11:24:47 -0400
commit84c815a12e7c2c816035e3b05e8ea7c88f0f4534 (patch)
tree2395d957a966e425bf310f3c23b663824e829999 /tests/functional/extension_permission_lang_test.php
parent474b4a60a527a4c0cd853872ce80ae50fdd2f374 (diff)
downloadforums-84c815a12e7c2c816035e3b05e8ea7c88f0f4534.tar
forums-84c815a12e7c2c816035e3b05e8ea7c88f0f4534.tar.gz
forums-84c815a12e7c2c816035e3b05e8ea7c88f0f4534.tar.bz2
forums-84c815a12e7c2c816035e3b05e8ea7c88f0f4534.tar.xz
forums-84c815a12e7c2c816035e3b05e8ea7c88f0f4534.zip
[ticket/11458] Add functional test
Since there is no test method to include extension language files, a functional test seems more appropriate. We add a permission mask 'acl_u_foo' with translation found in extenion 'bar' and confirm that the permission language file 'permissions_foo.php' from 'bar' was added by asserting that 'Can view foo' exists when viewing user permissions in acp PHPBB3-11458
Diffstat (limited to 'tests/functional/extension_permission_lang_test.php')
-rw-r--r--tests/functional/extension_permission_lang_test.php59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/functional/extension_permission_lang_test.php b/tests/functional/extension_permission_lang_test.php
new file mode 100644
index 0000000000..c3d136de49
--- /dev/null
+++ b/tests/functional/extension_permission_lang_test.php
@@ -0,0 +1,59 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_extension_permission_lang_test extends phpbb_functional_test_case
+{
+ protected $phpbb_extension_manager;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->phpbb_extension_manager = $this->get_extension_manager();
+
+ $this->purge_cache();
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/permissions');
+ }
+
+ public function test_auto_include_permission_lang_from_extensions()
+ {
+ $this->phpbb_extension_manager->enable('foo/bar');
+
+ // User permissions
+ $crawler = $this->request('GET', 'adm/index.php?i=acp_permissions&icat=16&mode=setting_user_global&sid=' . $this->sid);
+ $this->assert_response_success();
+ $this->assertContains('Can view foo', $this->client->getResponse()->getContent());
+ }
+
+ public function permissions_data()
+ {
+ return array(
+ // description
+ // permission type
+ // permission name
+ // mode
+ // object name
+ // object id
+ array(
+ 'user permission',
+ 'u_',
+ 'acl_u_foo',
+ 'setting_user_global',
+ 'user_id',
+ 2,
+ ),
+ );
+ }
+}