[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:
Nathan Guse 2012-10-20 21:55:58 -05:00
parent 7e6f31b51d
commit bc18e368c3
3 changed files with 30 additions and 7 deletions

View file

@ -701,10 +701,25 @@ class phpbb_notification_manager
->extension_directory($path) ->extension_directory($path)
->get_classes(); ->get_classes();
if (array_search('phpbb_notification_type_interface', $classes) !== false)
{
unset($classes[array_search('phpbb_notification_type_interface', $classes)]); 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)]); 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)]); 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)]); unset($classes[array_search('phpbb_notification_method_base', $classes)]);
}
return $classes; return $classes;
} }

View file

@ -32,4 +32,9 @@ class phpbb_mock_notifications_auth extends phpbb_auth
return $auth_list; return $auth_list;
} }
function acl_get($opt, $f = 0)
{
return true;
}
} }

View file

@ -69,7 +69,12 @@ class phpbb_notification_test extends phpbb_database_test_case
} }
$db = $this->new_dbal(); $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(); $user = new phpbb_mock_user();
$this->notifications = new phpbb_notification_manager( $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_quote', $subscription_types['NOTIFICATION_GROUP_POSTING']);
$this->assertArrayHasKey('phpbb_notification_type_topic', $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_notification_type_pm', $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);
$this->assertArrayHasKey('phpbb_ext_test_notification_type_test', $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']); $this->assertArrayHasKey('phpbb_ext_test_notification_type_test', $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);