aboutsummaryrefslogtreecommitdiffstats
path: root/tests/functional/user_password_reset_test.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-02-10 22:37:28 +0100
committerMarc Alexander <admin@m-a-styles.de>2014-02-10 22:37:28 +0100
commit488bd1a1b1e47cbcf570b5b7f2bf1ae77840888f (patch)
treeec2ff9cb034ac20c46f7dab7fac98a7b97dfb760 /tests/functional/user_password_reset_test.php
parentc864d06ac6dc09535cae7c2bbc6320d9ef5f4d74 (diff)
downloadforums-488bd1a1b1e47cbcf570b5b7f2bf1ae77840888f.tar
forums-488bd1a1b1e47cbcf570b5b7f2bf1ae77840888f.tar.gz
forums-488bd1a1b1e47cbcf570b5b7f2bf1ae77840888f.tar.bz2
forums-488bd1a1b1e47cbcf570b5b7f2bf1ae77840888f.tar.xz
forums-488bd1a1b1e47cbcf570b5b7f2bf1ae77840888f.zip
[ticket/12183] Add functional test for user password reset
PHPBB3-12183
Diffstat (limited to 'tests/functional/user_password_reset_test.php')
-rw-r--r--tests/functional/user_password_reset_test.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/functional/user_password_reset_test.php b/tests/functional/user_password_reset_test.php
new file mode 100644
index 0000000000..4e151202b1
--- /dev/null
+++ b/tests/functional/user_password_reset_test.php
@@ -0,0 +1,35 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_user_password_reset_test extends phpbb_functional_test_case
+{
+ public function test_password_reset()
+ {
+ $this->add_lang('ucp');
+ $this->create_user('reset-password-test-user');
+
+ $crawler = self::request('GET', "ucp.php?mode=sendpassword&sid={$this->sid}");
+ $form = $crawler->selectButton('submit')->form(array(
+ 'username' => 'reset-password-test-user',
+ ));
+ $crawler = self::submit($form);
+ $this->assertContainsLang('NO_EMAIL_USER', $crawler->text());
+
+ $crawler = self::request('GET', "ucp.php?mode=sendpassword&sid={$this->sid}");
+ $form = $crawler->selectButton('submit')->form(array(
+ 'username' => 'reset-password-test-user',
+ 'email' => 'nobody@example.com',
+ ));
+ $crawler = self::submit($form);
+ $this->assertContainsLang('PASSWORD_UPDATED', $crawler->text());
+ }
+}