From 42b7782927713c2ca2fb704db6217016347b586e Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 19 Mar 2017 21:46:20 +0700 Subject: [ticket/14972] Migrate from deprecated getMock() method to createMock() PHPBB3-14972 --- tests/auth/provider_apache_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auth/provider_apache_test.php') diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index 7d77d763fb..f30d19ef9d 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -27,7 +27,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case $config = new \phpbb\config\config(array()); $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); - $this->request = $this->getMock('\phpbb\request\request'); + $this->request = $this->createMock('\phpbb\request\request'); $this->user = new \phpbb\user($lang, '\phpbb\datetime'); $driver_helper = new \phpbb\passwords\driver\helper($config); $passwords_drivers = array( -- cgit v1.2.1 From ebac54aa9e705e99a562d2fe2c0f57bc6af8dd32 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 30 Dec 2018 11:36:08 +0100 Subject: [ticket/14948] Adjust calls for twig and phpunit updates PHPBB3-14948 --- tests/auth/provider_apache_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auth/provider_apache_test.php') diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index f30d19ef9d..0c26a0a186 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -17,7 +17,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case protected $user; protected $request; - protected function setup() + protected function setup(): void { parent::setUp(); -- cgit v1.2.1 From 9e772d1421e059d8898f2b095e341107a1502914 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 10 Aug 2019 22:21:14 +0200 Subject: [ticket/11327] Adjust tests for new reset password changes PHPBB3-11327 --- tests/auth/provider_apache_test.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/auth/provider_apache_test.php') diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index 0c26a0a186..58d6354228 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -202,6 +202,8 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case 'user_new' => '1', 'user_reminded' => '0', 'user_reminded_time' => '0', + 'reset_token' => '', + 'reset_token_expiration' => '0', ); $this->assertEquals($expected, $this->provider->autologin()); -- cgit v1.2.1 From 9e0c3fc81ec0c3006acc5aa3074cedb98f11e680 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 1 Nov 2019 14:30:27 +0100 Subject: [ticket/12574] Stop using passwords manager in apache provider PHPBB3-12574 --- tests/auth/provider_apache_test.php | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) (limited to 'tests/auth/provider_apache_test.php') diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index 58d6354228..b1c84d47b6 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -28,41 +28,14 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); $lang = new \phpbb\language\language($lang_loader); $this->request = $this->createMock('\phpbb\request\request'); - $this->user = new \phpbb\user($lang, '\phpbb\datetime'); - $driver_helper = new \phpbb\passwords\driver\helper($config); - $passwords_drivers = array( - 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($config, $driver_helper), - 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($config, $driver_helper), - 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($config, $driver_helper), - 'passwords.driver.phpass' => new \phpbb\passwords\driver\phpass($config, $driver_helper), - ); - - $passwords_helper = new \phpbb\passwords\helper; - // Set up passwords manager - $passwords_manager = new \phpbb\passwords\manager($config, $passwords_drivers, $passwords_helper, array_keys($passwords_drivers)); - - if (version_compare(PHP_VERSION, '5.3.7', '<')) - { - $this->password_hash = '$2a$10$e01Syh9PbJjUkio66eFuUu4FhCE2nRgG7QPc1JACalsPXcIuG2bbi'; - } - else - { - $this->password_hash = '$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i'; - } + $this->user = new \phpbb\user($lang, '\phpbb\datetime');; - $this->provider = new \phpbb\auth\provider\apache($db, $config, $passwords_manager, $this->request, $this->user, $phpbb_root_path, $phpEx); + $this->provider = new \phpbb\auth\provider\apache($config, $db, $lang, $this->request, $this->user, $phpbb_root_path, $phpEx); } public function getDataSet() { - if ((version_compare(PHP_VERSION, '5.3.7', '<'))) - { - return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user_533.xml'); - } - else - { - return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user.xml'); - } + return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user.xml'); } /** @@ -109,7 +82,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case 'user_row' => array( 'user_id' => '1', 'username' => 'foobar', - 'user_password' => $this->password_hash, + 'user_password' => '$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i', 'user_passchg' => '0', 'user_email' => 'example@example.com', 'user_type' => '0', @@ -145,7 +118,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case 'user_regdate' => '0', 'username' => 'foobar', 'username_clean' => 'foobar', - 'user_password' => $this->password_hash, + 'user_password' => '$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i', 'user_passchg' => '0', 'user_email' => 'example@example.com', 'user_email_hash' => '0', -- cgit v1.2.1 From 9872316cac4df4987fdabc9512ca6ebeb7e5e04f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 18 Nov 2019 21:06:00 +0100 Subject: [ticket/16167] Remove uses of user_email_hash PHPBB3-16167 --- tests/auth/provider_apache_test.php | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/auth/provider_apache_test.php') diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index b1c84d47b6..ebc97c204a 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -121,7 +121,6 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case 'user_password' => '$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i', 'user_passchg' => '0', 'user_email' => 'example@example.com', - 'user_email_hash' => '0', 'user_birthday' => '', 'user_lastvisit' => '0', 'user_lastmark' => '0', -- cgit v1.2.1 From d5f9e3a05eced92ce8a2ebd9a93f23770e1db6bb Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 22 Dec 2019 16:12:04 +0100 Subject: [ticket/16263] Do not expect numbers as strings in apache provider test PHPBB3-16263 --- tests/auth/provider_apache_test.php | 80 ++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'tests/auth/provider_apache_test.php') diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index ebc97c204a..0f9169ff8b 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -109,61 +109,61 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case ->will($this->returnValue('example')); $expected = array( - 'user_id' => '1', - 'user_type' => '0', - 'group_id' => '3', + 'user_id' => 1, + 'user_type' => 0, + 'group_id' => 3, 'user_permissions' => '', - 'user_perm_from' => '0', + 'user_perm_from' => 0, 'user_ip' => '', - 'user_regdate' => '0', + 'user_regdate' => 0, 'username' => 'foobar', 'username_clean' => 'foobar', 'user_password' => '$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i', - 'user_passchg' => '0', + 'user_passchg' => 0, 'user_email' => 'example@example.com', 'user_birthday' => '', - 'user_lastvisit' => '0', - 'user_lastmark' => '0', - 'user_lastpost_time' => '0', + 'user_lastvisit' => 0, + 'user_lastmark' => 0, + 'user_lastpost_time' => 0, 'user_lastpage' => '', 'user_last_confirm_key' => '', - 'user_last_search' => '0', - 'user_warnings' => '0', - 'user_last_warning' => '0', - 'user_login_attempts' => '0', - 'user_inactive_reason' => '0', - 'user_inactive_time' => '0', - 'user_posts' => '0', + 'user_last_search' => 0, + 'user_warnings' => 0, + 'user_last_warning' => 0, + 'user_login_attempts' => 0, + 'user_inactive_reason' => 0, + 'user_inactive_time' => 0, + 'user_posts' => 0, 'user_lang' => '', 'user_timezone' => '', 'user_dateformat' => 'd M Y H:i', - 'user_style' => '0', - 'user_rank' => '0', + 'user_style' => 0, + 'user_rank' => 0, 'user_colour' => '', - 'user_new_privmsg' => '0', - 'user_unread_privmsg' => '0', - 'user_last_privmsg' => '0', - 'user_message_rules' => '0', - 'user_full_folder' => '-3', - 'user_emailtime' => '0', - 'user_topic_show_days' => '0', + 'user_new_privmsg' => 0, + 'user_unread_privmsg' => 0, + 'user_last_privmsg' => 0, + 'user_message_rules' => 0, + 'user_full_folder' => -3, + 'user_emailtime' => 0, + 'user_topic_show_days' => 0, 'user_topic_sortby_type' => 't', 'user_topic_sortby_dir' => 'd', - 'user_post_show_days' => '0', + 'user_post_show_days' => 0, 'user_post_sortby_type' => 't', 'user_post_sortby_dir' => 'a', - 'user_notify' => '0', - 'user_notify_pm' => '1', - 'user_notify_type' => '0', - 'user_allow_pm' => '1', - 'user_allow_viewonline' => '1', - 'user_allow_viewemail' => '1', - 'user_allow_massemail' => '1', - 'user_options' => '230271', + 'user_notify' => 0, + 'user_notify_pm' => 1, + 'user_notify_type' => 0, + 'user_allow_pm' => 1, + 'user_allow_viewonline' => 1, + 'user_allow_viewemail' => 1, + 'user_allow_massemail' => 1, + 'user_options' => 230271, 'user_avatar' => '', 'user_avatar_type' => '', - 'user_avatar_width' => '0', - 'user_avatar_height' => '0', + 'user_avatar_width' => 0, + 'user_avatar_height' => 0, 'user_sig' => '', 'user_sig_bbcode_uid' => '', 'user_sig_bbcode_bitfield' => '', @@ -171,11 +171,11 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case 'user_actkey' => '', 'user_newpasswd' => '', 'user_form_salt' => '', - 'user_new' => '1', - 'user_reminded' => '0', - 'user_reminded_time' => '0', + 'user_new' => 1, + 'user_reminded' => 0, + 'user_reminded_time' => 0, 'reset_token' => '', - 'reset_token_expiration' => '0', + 'reset_token_expiration' => 0, ); $this->assertEquals($expected, $this->provider->autologin()); -- cgit v1.2.1