From 615d5eaa77016ba210d25b91b840cf328b66f95c Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 9 Aug 2020 15:17:49 +0700 Subject: [PATCH] [ticket/16549] Fix select auth method test PHPBB3-16549 --- tests/acp_board/select_auth_method_test.php | 26 ++++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/tests/acp_board/select_auth_method_test.php b/tests/acp_board/select_auth_method_test.php index 0ca3384469..b651fbedf9 100644 --- a/tests/acp_board/select_auth_method_test.php +++ b/tests/acp_board/select_auth_method_test.php @@ -21,23 +21,31 @@ class phpbb_acp_board_select_auth_method_test extends phpbb_test_case public static function select_auth_method_data() { - return array( - array('acp_board_valid', ''), - array('acp_board_invalid', ''), - ); + return [ + ['acp_board_valid', ''], + ['acp_board_invalid', ''], + ]; } protected function setUp(): void { parent::setUp(); - global $phpbb_container; + global $phpbb_container, $config; $phpbb_container = new phpbb_mock_container_builder(); + $config = new \phpbb\config\config([]); - $phpbb_container->set('auth.provider_collection', array( - 'auth.provider.acp_board_valid' => new phpbb\auth\provider\acp\board_valid, - 'auth.provider.acp_board_invalid' => new phpbb\auth\provider\acp\board_invalid, - )); + // Create auth provider service collection + $auth_provider_collection = new \phpbb\auth\provider_collection($phpbb_container, $config); + $phpbb_container->set('auth.provider_collection', $auth_provider_collection); + + // Create auth provider services + $phpbb_container->set('auth.provider.acp_board_valid', new phpbb\auth\provider\acp\board_valid); + $phpbb_container->set('auth.provider.acp_board_invalid', new phpbb\auth\provider\acp\board_invalid); + + // Add auth provider servives to the service collection + $auth_provider_collection->add('auth.provider.acp_board_valid'); + $auth_provider_collection->add('auth.provider.acp_board_invalid'); $this->acp_board = new acp_board(); }