aboutsummaryrefslogtreecommitdiffstats
path: root/tests/captcha/qa_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-01-31 12:19:03 +0100
committerMarc Alexander <admin@m-a-styles.de>2015-02-21 17:45:20 +0100
commit4167be1e2c5dc5ea9fcc7ed6b39f54cc68fef5b2 (patch)
tree40c17455d1f23b0c7c17edee3a932d88e4e93ea4 /tests/captcha/qa_test.php
parent5bfcc7e70780438b339731273e7793a74b24e59b (diff)
downloadforums-4167be1e2c5dc5ea9fcc7ed6b39f54cc68fef5b2.tar
forums-4167be1e2c5dc5ea9fcc7ed6b39f54cc68fef5b2.tar.gz
forums-4167be1e2c5dc5ea9fcc7ed6b39f54cc68fef5b2.tar.bz2
forums-4167be1e2c5dc5ea9fcc7ed6b39f54cc68fef5b2.tar.xz
forums-4167be1e2c5dc5ea9fcc7ed6b39f54cc68fef5b2.zip
[ticket/13522] Add tests for acp_get_question_input and set/get name
PHPBB3-13522
Diffstat (limited to 'tests/captcha/qa_test.php')
-rw-r--r--tests/captcha/qa_test.php47
1 files changed, 46 insertions, 1 deletions
diff --git a/tests/captcha/qa_test.php b/tests/captcha/qa_test.php
index 51bc09d309..fdf0c799f3 100644
--- a/tests/captcha/qa_test.php
+++ b/tests/captcha/qa_test.php
@@ -43,4 +43,49 @@ class phpbb_qa_test extends \phpbb_database_test_case
$this->assertTrue($this->qa->is_installed());
}
-} \ No newline at end of file
+
+ public function test_set_get_name()
+ {
+ $this->assertNull($this->qa->get_service_name());
+ $this->qa->set_name('foobar');
+ $this->assertSame('foobar', $this->qa->get_service_name());
+ }
+
+ public function data_acp_get_question_input()
+ {
+ return array(
+ array("foobar\ntest\nyes", array(
+ 'question_text' => '',
+ 'strict' => false,
+ 'lang_iso' => '',
+ 'answers' => array('foobar', 'test', 'yes')
+ )),
+ array("foobar\ntest\n \nyes", array(
+ 'question_text' => '',
+ 'strict' => false,
+ 'lang_iso' => '',
+ 'answers' => array(
+ 0 => 'foobar',
+ 1 => 'test',
+ 3 => 'yes',
+ )
+ )),
+ array('', array(
+ 'question_text' => '',
+ 'strict' => false,
+ 'lang_iso' => '',
+ 'answers' => '',
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider data_acp_get_question_input
+ */
+ public function test_acp_get_question_input($value, $expected)
+ {
+ $this->request->overwrite('answers', $value);
+
+ $this->assertEquals($expected, $this->qa->acp_get_question_input());
+ }
+}