From b1dbd5e9928669ec87c58f919bd1ce5c56ac718f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 26 Sep 2013 11:49:35 +0200 Subject: [ticket/11868] Add functional test for registration PHPBB3-11868 --- tests/functional/registration_test.php | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/functional/registration_test.php (limited to 'tests/functional/registration_test.php') diff --git a/tests/functional/registration_test.php b/tests/functional/registration_test.php new file mode 100644 index 0000000000..eb82b71fdf --- /dev/null +++ b/tests/functional/registration_test.php @@ -0,0 +1,49 @@ +login(); + $this->admin_login(); + + $crawler = self::request('GET', "adm/index.php?i=acp_board&mode=registration&sid={$this->sid}"); + $form = $crawler->selectButton('Submit')->form(); + $form['config[enable_confirm]']->setValue('0'); + $crawler = self::submit($form); + + $this->assertContainsLang('CONFIG_UPDATED', $crawler->filter('#main .successbox')->text()); + } + + public function test_register_new_account() + { + $this->add_lang('ucp'); + + $crawler = self::request('GET', 'ucp.php?mode=register'); + $this->assertContainsLang('REGISTRATION', $crawler->filter('div.content h2')->text()); + + $form = $crawler->selectButton('I agree to these terms')->form(); + $crawler = self::submit($form); + + $form = $crawler->selectButton('Submit')->form(array( + 'username' => 'user-reg-test', + 'email' => 'user-reg-test@phpbb.com', + 'new_password' => 'testtest', + 'password_confirm' => 'testtest', + )); + $form['tz']->select('Europe/Berlin'); + $crawler = self::submit($form); + + $this->assertContainsLang('ACCOUNT_ADDED', $crawler->filter('#message')->text()); + } +} -- cgit v1.2.1