mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/11103] Correct the test case
Fix a bug that broke it and make sure to set the needed config/auth settings PHPBB3-11103
This commit is contained in:
parent
7e6f31b51d
commit
bc18e368c3
3 changed files with 30 additions and 7 deletions
|
@ -701,10 +701,25 @@ class phpbb_notification_manager
|
|||
->extension_directory($path)
|
||||
->get_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;
|
||||
}
|
||||
|
|
|
@ -32,4 +32,9 @@ class phpbb_mock_notifications_auth extends phpbb_auth
|
|||
|
||||
return $auth_list;
|
||||
}
|
||||
|
||||
function acl_get($opt, $f = 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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']);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue