mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/13522] Add tests for acp_get_question_input and set/get name
PHPBB3-13522
This commit is contained in:
parent
5bfcc7e707
commit
4167be1e2c
1 changed files with 46 additions and 1 deletions
|
@ -43,4 +43,49 @@ class phpbb_qa_test extends \phpbb_database_test_case
|
||||||
|
|
||||||
$this->assertTrue($this->qa->is_installed());
|
$this->assertTrue($this->qa->is_installed());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue