From 27aa5e7b713b58eb0afb8d92e684a6868eb080ce Mon Sep 17 00:00:00 2001 From: Dhruv Date: Thu, 25 Apr 2013 22:58:03 +0530 Subject: [ticket/10325] functional tests for forgot password functionality PHPBB3-10325 --- tests/functional/forgot_password_test.php | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/functional/forgot_password_test.php (limited to 'tests/functional/forgot_password_test.php') 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()); + + } + +} -- cgit v1.2.1 From a5b5e4b31da6f91e73b09b3c2a50d1a79e8c108d Mon Sep 17 00:00:00 2001 From: Dhruv Date: Tue, 30 Apr 2013 22:29:20 +0530 Subject: [ticket/10325] add assert_response_success in test PHPBB3-10325 --- tests/functional/forgot_password_test.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/functional/forgot_password_test.php') diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index 3ae74ed1e9..14dfae3d7c 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -17,6 +17,7 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case global $config; $this->add_lang('ucp'); $crawler = $this->request('GET', 'ucp.php?mode=sendpassword'); + $this->assert_response_success(); $this->assertEquals($this->lang('SEND_PASSWORD'), $crawler->filter('h2')->text()); } @@ -26,6 +27,7 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case $this->admin_login(); $this->add_lang('ucp'); $crawler = $this->request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=security'); + //$this->assert_response_success(); $form = $crawler->selectButton('Submit')->form(); $values = $form->getValues(); @@ -37,7 +39,7 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case $this->logout(); $crawler = $this->request('GET', 'ucp.php?mode=sendpassword'); - + $this->assert_response_success(); $this->assertContains($this->lang('UCP_PASSWORD_RESET_DISABLED', '', ''), $crawler->text()); } -- cgit v1.2.1 From 1d0c8a1fe86b65174ae27c2353d52b69fda2a16d Mon Sep 17 00:00:00 2001 From: Dhruv Date: Tue, 30 Apr 2013 23:09:28 +0530 Subject: [ticket/10325] use assert_response_success parts PHPBB3-10325 --- tests/functional/forgot_password_test.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/functional/forgot_password_test.php') diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index 14dfae3d7c..bfb4616d64 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -27,7 +27,11 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case $this->admin_login(); $this->add_lang('ucp'); $crawler = $this->request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=security'); - //$this->assert_response_success(); + $this->assertEquals(200, $this->client->getResponse()->getStatus()); + $content = $this->client->getResponse()->getContent(); + $this->assertNotContains('Fatal error:', $content); + $this->assertNotContains('Notice:', $content); + $this->assertNotContains('[phpBB Debug]', $content); $form = $crawler->selectButton('Submit')->form(); $values = $form->getValues(); -- cgit v1.2.1 From 467c4d62c44a32a1a60bed2e2a2519b10cdebd33 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 28 May 2013 14:55:04 +0200 Subject: [ticket/develop/11568] Do not directly access $client from tests PHPBB3-11568 --- tests/functional/forgot_password_test.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'tests/functional/forgot_password_test.php') diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index bfb4616d64..7c5f27c07e 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -27,18 +27,13 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case $this->admin_login(); $this->add_lang('ucp'); $crawler = $this->request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=security'); - $this->assertEquals(200, $this->client->getResponse()->getStatus()); - $content = $this->client->getResponse()->getContent(); - $this->assertNotContains('Fatal error:', $content); - $this->assertNotContains('Notice:', $content); - $this->assertNotContains('[phpBB Debug]', $content); $form = $crawler->selectButton('Submit')->form(); $values = $form->getValues(); $values["config[allow_password_reset]"] = 0; $form->setValues($values); - $crawler = $this->client->submit($form); + $crawler = $this->submit($form); $this->logout(); -- cgit v1.2.1 From f1523944a048e22207d6f200c6d152ecb9fdc136 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 28 May 2013 14:58:40 +0200 Subject: [ticket/develop/11568] Remove unneccessary calls to assert_response_success() PHPBB3-11568 --- tests/functional/forgot_password_test.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests/functional/forgot_password_test.php') diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index 7c5f27c07e..65d07672cf 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -17,7 +17,6 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case global $config; $this->add_lang('ucp'); $crawler = $this->request('GET', 'ucp.php?mode=sendpassword'); - $this->assert_response_success(); $this->assertEquals($this->lang('SEND_PASSWORD'), $crawler->filter('h2')->text()); } @@ -38,7 +37,6 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case $this->logout(); $crawler = $this->request('GET', 'ucp.php?mode=sendpassword'); - $this->assert_response_success(); $this->assertContains($this->lang('UCP_PASSWORD_RESET_DISABLED', '', ''), $crawler->text()); } -- cgit v1.2.1 From 4c62cb4989fbf8d2fa9f5d60839311ea5b4c5f68 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 11 Feb 2014 08:24:12 +0100 Subject: [ticket/12183] Make sure to undo changes to config in forgot_password_test The forgot_password_test disables the password reset functionalty but doesn't enable it again afterwards. PHPBB3-12183 --- tests/functional/forgot_password_test.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/functional/forgot_password_test.php') diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index 906224efbb..3b6fd15d02 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -41,4 +41,17 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case } + public function tearDown() + { + $this->login(); + $this->admin_login(); + + $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=security'); + + // Enable allow_password_reset again after test + $form = $crawler->selectButton('Submit')->form(array( + 'config[allow_password_reset]' => 1, + )); + $crawler = self::submit($form); + } } -- cgit v1.2.1 From a759704b39fc1c1353f865a633759b1369589b67 Mon Sep 17 00:00:00 2001 From: Yuriy Rusko Date: Tue, 27 May 2014 20:18:06 +0200 Subject: [ticket/12594] Remove @package tags and update file headers PHPBB3-12594 --- tests/functional/forgot_password_test.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests/functional/forgot_password_test.php') diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index 3b6fd15d02..64fa19557f 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -1,9 +1,13 @@ +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. * */ -- cgit v1.2.1 From 019b345171d271535b32b09f82ad24c16ec8b0b8 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sat, 14 Jun 2014 15:30:47 +0530 Subject: [ticket/11528] Call parent::tearDown in overrided tearDown method PHPBB3-11528 --- tests/functional/forgot_password_test.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/functional/forgot_password_test.php') diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index 64fa19557f..efb5f64f87 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -47,6 +47,8 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case public function tearDown() { + parent::tearDown(); + $this->login(); $this->admin_login(); -- cgit v1.2.1 From c26fa6a15b716dcf43d063b41ec5d646fc115e19 Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sat, 14 Jun 2014 17:46:35 +0530 Subject: [ticket/11528] Move parent::tearDown() to end of tearDown() PHPBB3-11528 --- tests/functional/forgot_password_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/functional/forgot_password_test.php') diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index efb5f64f87..c95efc5b2e 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -47,8 +47,6 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case public function tearDown() { - parent::tearDown(); - $this->login(); $this->admin_login(); @@ -59,5 +57,7 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case 'config[allow_password_reset]' => 1, )); $crawler = self::submit($form); + + parent::tearDown(); } } -- cgit v1.2.1 From dd8adb5d6eca9b1bc359ff3a0ff72b0531dfb9cd Mon Sep 17 00:00:00 2001 From: Dhruv Date: Sat, 9 Aug 2014 17:18:33 +0200 Subject: [ticket/11528] Revert Mink changes PHPBB3-11528 --- tests/functional/forgot_password_test.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests/functional/forgot_password_test.php') diff --git a/tests/functional/forgot_password_test.php b/tests/functional/forgot_password_test.php index c95efc5b2e..64fa19557f 100644 --- a/tests/functional/forgot_password_test.php +++ b/tests/functional/forgot_password_test.php @@ -57,7 +57,5 @@ class phpbb_functional_forgot_password_test extends phpbb_functional_test_case 'config[allow_password_reset]' => 1, )); $crawler = self::submit($form); - - parent::tearDown(); } } -- cgit v1.2.1