diff options
author | Dhruv <dhruv.goel92@gmail.com> | 2013-04-25 22:58:03 +0530 |
---|---|---|
committer | Dhruv <dhruv.goel92@gmail.com> | 2013-04-25 22:58:03 +0530 |
commit | 27aa5e7b713b58eb0afb8d92e684a6868eb080ce (patch) | |
tree | 47f3b9b1b7e547211e109105e7e648d54043ce51 /tests | |
parent | 2fa5f9591e06e82ca76e7ac7e653d8ad4494eb67 (diff) | |
download | forums-27aa5e7b713b58eb0afb8d92e684a6868eb080ce.tar forums-27aa5e7b713b58eb0afb8d92e684a6868eb080ce.tar.gz forums-27aa5e7b713b58eb0afb8d92e684a6868eb080ce.tar.bz2 forums-27aa5e7b713b58eb0afb8d92e684a6868eb080ce.tar.xz forums-27aa5e7b713b58eb0afb8d92e684a6868eb080ce.zip |
[ticket/10325] functional tests for forgot password functionality
PHPBB3-10325
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/forgot_password_test.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php new file mode 100644 index 0000000000..3ae74ed1e9 --- /dev/null +++ b/tests/functional/forgot_password_test.php @@ -0,0 +1,45 @@ +<?php +/** +* +* @package testing +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @group functional +*/ +class phpbb_functional_forgot_password_test extends phpbb_functional_test_case +{ + public function test_forgot_password_enabled() + { + global $config; + $this->add_lang('ucp'); + $crawler = $this->request('GET', 'ucp.php?mode=sendpassword'); + $this->assertEquals($this->lang('SEND_PASSWORD'), $crawler->filter('h2')->text()); + } + + public function test_forgot_password_disabled() + { + $this->login(); + $this->admin_login(); + $this->add_lang('ucp'); + $crawler = $this->request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=security'); + + $form = $crawler->selectButton('Submit')->form(); + $values = $form->getValues(); + + $values["config[allow_password_reset]"] = 0; + $form->setValues($values); + $crawler = $this->client->submit($form); + + $this->logout(); + + $crawler = $this->request('GET', 'ucp.php?mode=sendpassword'); + + $this->assertContains($this->lang('UCP_PASSWORD_RESET_DISABLED', '', ''), $crawler->text()); + + } + +} |