diff options
author | Matt Friedman <maf675@gmail.com> | 2016-02-29 11:41:47 -0800 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2016-02-29 11:41:47 -0800 |
commit | d373428180e884f03a830aa69fe8ff2cd6a5140a (patch) | |
tree | e364729640cad537417088efc5147155c7a66aa2 /tests/console | |
parent | [ticket/12684] Updates for 3.2 API (diff) | |
download | phpbb-d373428180e884f03a830aa69fe8ff2cd6a5140a.tar.gz phpbb-d373428180e884f03a830aa69fe8ff2cd6a5140a.tar.bz2 phpbb-d373428180e884f03a830aa69fe8ff2cd6a5140a.zip |
[ticket/12684] Add input validation
PHPBB3-12684
Diffstat (limited to 'tests/console')
-rw-r--r-- | tests/console/user/add_test.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/console/user/add_test.php b/tests/console/user/add_test.php index 5e4b76063e..280adb101d 100644 --- a/tests/console/user/add_test.php +++ b/tests/console/user/add_test.php @@ -49,6 +49,11 @@ class phpbb_console_command_user_add_test extends phpbb_database_test_case $config = $this->config = new \phpbb\config\config(array( 'board_timezone' => 'UTC', 'default_lang' => 'en', + 'min_name_chars' => 3, + 'max_name_chars' => 10, + 'min_pass_chars' => 3, + 'max_pass_chars' => 10, + 'pass_complex' => 'PASS_TYPE_ANY', )); $db = $this->db = $this->new_dbal(); @@ -110,6 +115,24 @@ class phpbb_console_command_user_add_test extends phpbb_database_test_case } + public function test_add_no_dialog_invalid() + { + $command_tester = $this->get_command_tester(); + + $this->assertEquals(3, $this->get_user_id('Test')); + + $command_tester->execute(array( + 'command' => $this->command_name, + '--username' => 'Test', + '--password' => '1', + '--email' => 'foo' + )); + + $this->assertContains('USERNAME_TAKEN', $command_tester->getDisplay()); + $this->assertContains('TOO_SHORT', $command_tester->getDisplay()); + $this->assertContains('EMAIL_INVALID', $command_tester->getDisplay()); + } + public function get_command_tester() { $application = new Application(); |