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 @@ +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()); + + } + +}