mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 22:08:54 +00:00
[ticket/10325] functional tests for forgot password functionality
PHPBB3-10325
This commit is contained in:
parent
2fa5f9591e
commit
27aa5e7b71
1 changed files with 45 additions and 0 deletions
45
tests/functional/forgot_password_test.php
Normal file
45
tests/functional/forgot_password_test.php
Normal file
|
@ -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());
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue