diff options
author | Matt Friedman <maf675@gmail.com> | 2015-10-13 23:40:52 -0700 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2015-10-13 23:40:52 -0700 |
commit | b64a37d451132dcf7ef5fc3d6e700a6fb6decd90 (patch) | |
tree | 8432ace2597886cfbf20bcfdd27e39cd17c1f6b1 /tests | |
parent | 03cb2a7b0c5a3756522c27d708bdaf0bfa771706 (diff) | |
download | forums-b64a37d451132dcf7ef5fc3d6e700a6fb6decd90.tar forums-b64a37d451132dcf7ef5fc3d6e700a6fb6decd90.tar.gz forums-b64a37d451132dcf7ef5fc3d6e700a6fb6decd90.tar.bz2 forums-b64a37d451132dcf7ef5fc3d6e700a6fb6decd90.tar.xz forums-b64a37d451132dcf7ef5fc3d6e700a6fb6decd90.zip |
[ticket/14237] Use $language class for notifications
PHPBB3-14237
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mock/notification_type_post.php | 3 | ||||
-rw-r--r-- | tests/notification/base.php | 2 | ||||
-rw-r--r-- | tests/notification/fixtures/services_notification.yml | 3 | ||||
-rw-r--r-- | tests/notification/submit_post_base.php | 10 | ||||
-rw-r--r-- | tests/notification/user_list_trim_test.php | 4 |
5 files changed, 16 insertions, 6 deletions
diff --git a/tests/mock/notification_type_post.php b/tests/mock/notification_type_post.php index fd2d1b63cd..4116fecf5e 100644 --- a/tests/mock/notification_type_post.php +++ b/tests/mock/notification_type_post.php @@ -21,11 +21,12 @@ if (!defined('IN_PHPBB')) class phpbb_mock_notification_type_post extends \phpbb\notification\type\post { - public function __construct($user_loader, $db, $cache, $user, $auth, $config, $phpbb_root_path, $php_ext, $notification_types_table, $user_notifications_table) + public function __construct($user_loader, $db, $cache, $language, $user, $auth, $config, $phpbb_root_path, $php_ext, $notification_types_table, $user_notifications_table) { $this->user_loader = $user_loader; $this->db = $db; $this->cache = $cache; + $this->language = $language; $this->user = $user; $this->auth = $auth; $this->config = $config; diff --git a/tests/notification/base.php b/tests/notification/base.php index 1295f099f0..b64e25cf8c 100644 --- a/tests/notification/base.php +++ b/tests/notification/base.php @@ -90,6 +90,7 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case $loader->load('services_notification.yml'); $phpbb_container->set('user_loader', $this->user_loader); $phpbb_container->set('user', $user); + $phpbb_container->set('language', $lang); $phpbb_container->set('config', $this->config); $phpbb_container->set('dbal.conn', $this->db); $phpbb_container->set('auth', $auth); @@ -111,6 +112,7 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case $this->phpbb_dispatcher, $this->db, $this->cache, + $lang, $this->user, 'phpbb_notification_types', 'phpbb_user_notifications' diff --git a/tests/notification/fixtures/services_notification.yml b/tests/notification/fixtures/services_notification.yml index e0a404b12b..6e68cccff6 100644 --- a/tests/notification/fixtures/services_notification.yml +++ b/tests/notification/fixtures/services_notification.yml @@ -17,6 +17,9 @@ services: dbal.conn: synthetic: true + language: + synthetic: true + auth: synthetic: true diff --git a/tests/notification/submit_post_base.php b/tests/notification/submit_post_base.php index 72b25abf0a..14ca4499d2 100644 --- a/tests/notification/submit_post_base.php +++ b/tests/notification/submit_post_base.php @@ -54,7 +54,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c { parent::setUp(); - global $auth, $cache, $config, $db, $phpbb_container, $phpbb_dispatcher, $user, $request, $phpEx, $phpbb_root_path, $user_loader; + global $auth, $cache, $config, $db, $phpbb_container, $phpbb_dispatcher, $lang, $user, $request, $phpEx, $phpbb_root_path, $user_loader; // Database $this->db = $this->new_dbal(); @@ -91,9 +91,12 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c // Event dispatcher $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); + // Language + $lang = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)); + // User $user = $this->getMock('\phpbb\user', array(), array( - new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), + $lang, '\phpbb\datetime' )); $user->ip = ''; @@ -117,6 +120,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c $loader->load('services_notification.yml'); $phpbb_container->set('user_loader', $user_loader); $phpbb_container->set('user', $user); + $phpbb_container->set('language', $lang); $phpbb_container->set('config', $config); $phpbb_container->set('dbal.conn', $db); $phpbb_container->set('auth', $auth); @@ -146,7 +150,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c // Notification Manager $phpbb_notifications = new \phpbb\notification\manager($notification_types_array, $notification_methods_array, - $phpbb_container, $user_loader, $phpbb_dispatcher, $db, $cache, $user, + $phpbb_container, $user_loader, $phpbb_dispatcher, $db, $cache, $lang, $user, NOTIFICATION_TYPES_TABLE, USER_NOTIFICATIONS_TABLE); $phpbb_container->set('notification_manager', $phpbb_notifications); } diff --git a/tests/notification/user_list_trim_test.php b/tests/notification/user_list_trim_test.php index d57fbf0485..9f6eb492f6 100644 --- a/tests/notification/user_list_trim_test.php +++ b/tests/notification/user_list_trim_test.php @@ -55,13 +55,13 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case $lang = new \phpbb\language\language($lang_loader); $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->data = array('user_lang' => 'en'); - $user->add_lang('common'); + $lang->add_lang('common'); $user_loader = new phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE); $user_loader->load_users(array(2, 3, 4, 5, 6)); $this->notification = new phpbb_mock_notification_type_post( - $user_loader, null, null, $user, null, null, $phpbb_root_path, $phpEx, null, null + $user_loader, null, null, $lang, $user, null, null, $phpbb_root_path, $phpEx, null, null ); } |