aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/notification/manager.php23
-rw-r--r--tests/mock/notifications_auth.php5
-rw-r--r--tests/notification/notification.php9
3 files changed, 30 insertions, 7 deletions
diff --git a/phpBB/includes/notification/manager.php b/phpBB/includes/notification/manager.php
index 06ebaf24c4..75155c5dc3 100644
--- a/phpBB/includes/notification/manager.php
+++ b/phpBB/includes/notification/manager.php
@@ -701,10 +701,25 @@ class phpbb_notification_manager
->extension_directory($path)
->get_classes();
- unset($classes[array_search('phpbb_notification_type_interface', $classes)]);
- unset($classes[array_search('phpbb_notification_type_base', $classes)]);
- unset($classes[array_search('phpbb_notification_method_interface', $classes)]);
- unset($classes[array_search('phpbb_notification_method_base', $classes)]);
+ if (array_search('phpbb_notification_type_interface', $classes) !== false)
+ {
+ unset($classes[array_search('phpbb_notification_type_interface', $classes)]);
+ }
+
+ if (array_search('phpbb_notification_type_base', $classes) !== false)
+ {
+ unset($classes[array_search('phpbb_notification_type_base', $classes)]);
+ }
+
+ if (array_search('phpbb_notification_method_interface', $classes) !== false)
+ {
+ unset($classes[array_search('phpbb_notification_method_interface', $classes)]);
+ }
+
+ if (array_search('phpbb_notification_method_base', $classes) !== false)
+ {
+ unset($classes[array_search('phpbb_notification_method_base', $classes)]);
+ }
return $classes;
}
diff --git a/tests/mock/notifications_auth.php b/tests/mock/notifications_auth.php
index d1c1458de7..d960acb81a 100644
--- a/tests/mock/notifications_auth.php
+++ b/tests/mock/notifications_auth.php
@@ -32,4 +32,9 @@ class phpbb_mock_notifications_auth extends phpbb_auth
return $auth_list;
}
+
+ function acl_get($opt, $f = 0)
+ {
+ return true;
+ }
}
diff --git a/tests/notification/notification.php b/tests/notification/notification.php
index 0bb69dc2c5..bb671e62ef 100644
--- a/tests/notification/notification.php
+++ b/tests/notification/notification.php
@@ -69,7 +69,12 @@ class phpbb_notification_test extends phpbb_database_test_case
}
$db = $this->new_dbal();
- $config = new phpbb_config(array());
+ $config = new phpbb_config(array(
+ 'allow_privmsg' => true,
+ 'allow_bookmarks' => true,
+ 'allow_topic_notify' => true,
+ 'allow_forum_notify' => true,
+ ));
$user = new phpbb_mock_user();
$this->notifications = new phpbb_notification_manager(
@@ -105,8 +110,6 @@ class phpbb_notification_test extends phpbb_database_test_case
$this->assertArrayHasKey('phpbb_notification_type_quote', $subscription_types['NOTIFICATION_GROUP_POSTING']);
$this->assertArrayHasKey('phpbb_notification_type_topic', $subscription_types['NOTIFICATION_GROUP_POSTING']);
- $this->assertArrayHasKey('moderation_queue', $subscription_types['NOTIFICATION_GROUP_POSTING']);
-
$this->assertArrayHasKey('phpbb_notification_type_pm', $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);
$this->assertArrayHasKey('phpbb_ext_test_notification_type_test', $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);