From 477f7823e5f51b083c13881d221835ae34c15b8f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 6 Apr 2015 12:08:55 +0200 Subject: [ticket/13522] Fix globals for 3.2 in Q&A tests PHPBB3-13522 --- tests/captcha/qa_test.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/captcha/qa_test.php') diff --git a/tests/captcha/qa_test.php b/tests/captcha/qa_test.php index 1f2f9f3070..4aa5e714f5 100644 --- a/tests/captcha/qa_test.php +++ b/tests/captcha/qa_test.php @@ -27,14 +27,16 @@ class phpbb_captcha_qa_test extends \phpbb_database_test_case public function setUp() { - global $db; + global $db, $request, $phpbb_container; $db = $this->new_dbal(); parent::setUp(); - $this->request = new \phpbb_mock_request(); - request_var(false, false, false, false, $this->request); + $request = new \phpbb_mock_request(); + $phpbb_container = new \phpbb_mock_container_builder(); + $factory = new \phpbb\db\tools\factory(); + $phpbb_container->set('dbal.tools', $factory->get($db)); $this->qa = new \phpbb\captcha\plugins\qa('phpbb_captcha_questions', 'phpbb_captcha_answers', 'phpbb_qa_confirm'); } @@ -87,7 +89,8 @@ class phpbb_captcha_qa_test extends \phpbb_database_test_case */ public function test_acp_get_question_input($value, $expected) { - $this->request->overwrite('answers', $value); + global $request; + $request->overwrite('answers', $value); $this->assertEquals($expected, $this->qa->acp_get_question_input()); } -- cgit v1.2.1