diff options
author | Marc Alexander <admin@m-a-styles.de> | 2015-01-29 20:57:21 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2015-02-21 17:45:20 +0100 |
commit | 5bfcc7e70780438b339731273e7793a74b24e59b (patch) | |
tree | 38d8e285b62cd40b0ca00b158053d2d377ae3fc5 | |
parent | d15e5372caf1d0811e1f2bc87d5deddba171cb09 (diff) | |
download | forums-5bfcc7e70780438b339731273e7793a74b24e59b.tar forums-5bfcc7e70780438b339731273e7793a74b24e59b.tar.gz forums-5bfcc7e70780438b339731273e7793a74b24e59b.tar.bz2 forums-5bfcc7e70780438b339731273e7793a74b24e59b.tar.xz forums-5bfcc7e70780438b339731273e7793a74b24e59b.zip |
[ticket/13522] Add test file for Q&A captcha
PHPBB3-13522
-rw-r--r-- | tests/captcha/qa_test.php | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/captcha/qa_test.php b/tests/captcha/qa_test.php new file mode 100644 index 0000000000..51bc09d309 --- /dev/null +++ b/tests/captcha/qa_test.php @@ -0,0 +1,46 @@ +<?php +/** + * + * This file is part of the phpBB Forum Software package. + * + * @copyright (c) phpBB Limited <https://www.phpbb.com> + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +class phpbb_qa_test extends \phpbb_database_test_case +{ + protected $request; + + /** @var \phpbb\captcha\plugins\qa */ + protected $qa; + + public function getDataSet() + { + return $this->createXMLDataSet(dirname(__FILE__) . '/../fixtures/empty.xml'); + } + + public function setUp() + { + global $db; + + $db = $this->new_dbal(); + + parent::setUp(); + + $this->request = new \phpbb_mock_request(); + $this->qa = new \phpbb\captcha\plugins\qa($this->request, 'phpbb_captcha_questions', 'phpbb_captcha_answers', 'phpbb_qa_confirm'); + } + + public function test_is_installed() + { + $this->assertFalse($this->qa->is_installed()); + + $this->qa->install(); + + $this->assertTrue($this->qa->is_installed()); + } +}
\ No newline at end of file |