mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/11103] Mock notification manager
Fixing delete_user_pms_test.php PHPBB3-11103
This commit is contained in:
parent
ff136cc96a
commit
33371effc4
2 changed files with 78 additions and 1 deletions
76
tests/mock/notification_manager.php
Normal file
76
tests/mock/notification_manager.php
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package notifications
|
||||||
|
* @copyright (c) 2012 phpBB Group
|
||||||
|
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*/
|
||||||
|
if (!defined('IN_PHPBB'))
|
||||||
|
{
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notifications service class
|
||||||
|
* @package notifications
|
||||||
|
*/
|
||||||
|
class phpbb_mock_notification_manager
|
||||||
|
{
|
||||||
|
public function load_notifications()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'notifications' => array(),
|
||||||
|
'unread_count' => 0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function mark_notifications_read() {}
|
||||||
|
|
||||||
|
public function mark_notifications_read_by_parent() {}
|
||||||
|
|
||||||
|
public function mark_notifications_read_by_id() {}
|
||||||
|
|
||||||
|
|
||||||
|
public function add_notifications()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function add_notifications_for_users() {}
|
||||||
|
|
||||||
|
public function update_notifications() {}
|
||||||
|
|
||||||
|
public function delete_notifications() {}
|
||||||
|
|
||||||
|
public function get_subscription_types()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_subscription_methods()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function get_subscriptions()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function add_subscription() {}
|
||||||
|
|
||||||
|
public function delete_subscription() {}
|
||||||
|
|
||||||
|
public function load_users() {}
|
||||||
|
|
||||||
|
public function get_user()
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -81,9 +81,10 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case
|
||||||
*/
|
*/
|
||||||
public function test_delete_user_pms($delete_user, $remaining_privmsgs, $remaining_privmsgs_to)
|
public function test_delete_user_pms($delete_user, $remaining_privmsgs, $remaining_privmsgs_to)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db, $phpbb_notifications;
|
||||||
|
|
||||||
$db = $this->new_dbal();
|
$db = $this->new_dbal();
|
||||||
|
$phpbb_notifications = new phpbb_mock_notification_manager();
|
||||||
|
|
||||||
phpbb_delete_user_pms($delete_user);
|
phpbb_delete_user_pms($delete_user);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue