mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/13522] Fix globals for 3.2 in Q&A tests
PHPBB3-13522
This commit is contained in:
parent
8523031141
commit
477f7823e5
1 changed files with 7 additions and 4 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue