1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 11:13:59 +02:00

[ticket/17135] Refactor messenger code to services

PHPBB3-17135
This commit is contained in:
rxu
2023-06-08 21:17:01 +07:00
parent f95816cbe3
commit a7b5369138
22 changed files with 191 additions and 149 deletions

View File

@@ -146,6 +146,11 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case
$phpbb_container->addCompilerPass(new phpbb\di\pass\markpublic_pass());
$messenger_method_collection = new \phpbb\di\service_collection($phpbb_container);
$messenger_method_collection->add('messenger.method.email');
$messenger_method_collection->add('messenger.method.jabber');
$phpbb_container->set('messenger.method_collection', $messenger_method_collection);
$phpbb_container->compile();
$this->notifications->setDependencies($this->auth, $this->config);

View File

@@ -105,6 +105,11 @@ class notification_method_email_test extends phpbb_tests_notification_base
)
);
$messenger_method_collection = new \phpbb\di\service_collection($phpbb_container);
$messenger_method_collection->add('messenger.method.email');
$messenger_method_collection->add('messenger.method.jabber');
$phpbb_container->set('messenger.method_collection', $messenger_method_collection);
$this->notification_method_email = $this->getMockBuilder('\phpbb\notification\method\email')
->setConstructorArgs([
$phpbb_container->get('user_loader'),
@@ -113,7 +118,8 @@ class notification_method_email_test extends phpbb_tests_notification_base
$phpbb_container->get('dbal.conn'),
$phpbb_root_path,
$phpEx,
$phpbb_container->getParameter('tables.notification_emails')
$phpbb_container->getParameter('tables.notification_emails'),
$phpbb_container->get('messenger.method_collection')
])
->setMethods(['notify_using_messenger'])
->getMock();

View File

@@ -158,6 +158,12 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c
$phpbb_container->setParameter('tables.notification_push', 'phpbb_notification_push');
$phpbb_container->setParameter('tables.push_subscriptions', 'phpbb_push_subscriptions');
$phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
$messenger_method_collection = new \phpbb\di\service_collection($phpbb_container);
$messenger_method_collection->add('messenger.method.email');
$messenger_method_collection->add('messenger.method.jabber');
$phpbb_container->set('messenger.method_collection', $messenger_method_collection);
$phpbb_container->addCompilerPass(new phpbb\di\pass\markpublic_pass());
$phpbb_container->compile();