aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/fixtures
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-07-13 23:31:13 -0400
committerJoas Schilling <nickvergessen@gmx.de>2013-07-14 12:02:48 -0400
commitcfb13bb5476dfa7895f984405d6a0c40ddcda08e (patch)
treead38a1b1a371f88a0debb661b60dca826b62d08d /tests/functional/fixtures
parent060754fd6ce998caf8b8e182f53a1464e16e9deb (diff)
downloadforums-cfb13bb5476dfa7895f984405d6a0c40ddcda08e.tar
forums-cfb13bb5476dfa7895f984405d6a0c40ddcda08e.tar.gz
forums-cfb13bb5476dfa7895f984405d6a0c40ddcda08e.tar.bz2
forums-cfb13bb5476dfa7895f984405d6a0c40ddcda08e.tar.xz
forums-cfb13bb5476dfa7895f984405d6a0c40ddcda08e.zip
[ticket/11582] Fix extension permission tests
PHPBB3-11582
Diffstat (limited to 'tests/functional/fixtures')
-rw-r--r--tests/functional/fixtures/ext/foo/bar/event/permission_listener.php40
-rw-r--r--tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php3
2 files changed, 41 insertions, 2 deletions
diff --git a/tests/functional/fixtures/ext/foo/bar/event/permission_listener.php b/tests/functional/fixtures/ext/foo/bar/event/permission_listener.php
new file mode 100644
index 0000000000..dfabf7c540
--- /dev/null
+++ b/tests/functional/fixtures/ext/foo/bar/event/permission_listener.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+*
+* @package testing
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @ignore
+*/
+
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* Event listener
+*/
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+class phpbb_ext_foo_bar_event_permission_listener implements EventSubscriberInterface
+{
+ static public function getSubscribedEvents()
+ {
+ return array(
+ 'core.permissions' => 'add_permissions',
+ );
+ }
+
+ public function add_permissions($event)
+ {
+ $permissions = $event['permissions'];
+ $permissions['u_foo'] = array('lang' => 'ACL_U_FOO', 'cat' => 'misc'),
+ $event['permissions'] = $permissions;
+ }
+}
diff --git a/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php b/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php
index cd4b9a32d1..36c84c5209 100644
--- a/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php
+++ b/tests/functional/fixtures/ext/foo/bar/language/en/permissions_foo.php
@@ -1,6 +1,5 @@
<?php
-// Admin Permissions
$lang = array_merge($lang, array(
- 'acl_u_foo' => array('lang' => 'Can view foo', 'cat' => 'misc'),
+ 'ACL_U_FOO' => 'Can view foo',
));