diff options
author | javiexin <javiexin@gmail.com> | 2017-05-21 18:25:57 +0200 |
---|---|---|
committer | javiexin <javiexin@gmail.com> | 2017-05-21 18:25:57 +0200 |
commit | 37c48a59c318c12547c371f0d0a8bc84f5206dcf (patch) | |
tree | a45b111970e291ff871733cfe003a74e0631c441 /tests/captcha/qa_test.php | |
parent | 60d6667eb4c5ad8a02d67dea62bc2d5b9553f958 (diff) | |
parent | bd12504f6cf03b36821a5cea2bf77a419496dcdb (diff) | |
download | forums-37c48a59c318c12547c371f0d0a8bc84f5206dcf.tar forums-37c48a59c318c12547c371f0d0a8bc84f5206dcf.tar.gz forums-37c48a59c318c12547c371f0d0a8bc84f5206dcf.tar.bz2 forums-37c48a59c318c12547c371f0d0a8bc84f5206dcf.tar.xz forums-37c48a59c318c12547c371f0d0a8bc84f5206dcf.zip |
Merge branch 'ticket/15068' of https://github.com/javiexin/phpbb into ticket/15068
Diffstat (limited to 'tests/captcha/qa_test.php')
-rw-r--r-- | tests/captcha/qa_test.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/captcha/qa_test.php b/tests/captcha/qa_test.php index 1f2f9f3070..7ec4be69f5 100644 --- a/tests/captcha/qa_test.php +++ b/tests/captcha/qa_test.php @@ -11,8 +11,6 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; - class phpbb_captcha_qa_test extends \phpbb_database_test_case { protected $request; @@ -27,14 +25,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 +87,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()); } |