From cafc7feca12730fce59091bd7a18fb5c3f7ecdc0 Mon Sep 17 00:00:00 2001 From: Fyorl Date: Mon, 9 Jul 2012 00:24:28 +0100 Subject: [ticket/10972] Moved tests into appropriate places and added comments PHPBB3-10972 --- tests/functional/auth_test.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/functional/auth_test.php') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index e955dcb4df..e67118d8f9 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -21,6 +21,15 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case $this->assertContains($this->lang('LOGOUT_USER', 'admin'), $crawler->filter('.navbar')->text()); } + public function test_login_other() + { + $this->create_user('user'); + $this->login('user'); + $crawler = $this->request('GET', 'index.php'); + $this->assertContains('user', $crawler->filter('.icon-logout')->text()); + $this->delete_user('user'); + } + /** * @depends test_login */ -- cgit v1.2.1 From fb5c4440e598f2a775a52299a06e903d3cee5398 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 6 Dec 2012 23:43:22 -0500 Subject: [ticket/10972] Tweak user addition. Always add users, do not keep track of which users have been added. The tests should know whether users they want exist or not. Use more unique user names in tests for robustness. Added some more assertions here and there. PHPBB3-10972 --- tests/functional/auth_test.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tests/functional/auth_test.php') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index e67118d8f9..3e218ebd77 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -18,16 +18,18 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case // check for logout link $crawler = $this->request('GET', 'index.php'); + $this->assert_response_success(); $this->assertContains($this->lang('LOGOUT_USER', 'admin'), $crawler->filter('.navbar')->text()); } public function test_login_other() { - $this->create_user('user'); - $this->login('user'); + $this->create_user('anothertestuser'); + $this->login('anothertestuser'); $crawler = $this->request('GET', 'index.php'); - $this->assertContains('user', $crawler->filter('.icon-logout')->text()); - $this->delete_user('user'); + $this->assert_response_success(); + $this->assertContains('anothertestuser', $crawler->filter('.icon-logout')->text()); + $this->delete_user('anothertestuser'); } /** @@ -40,10 +42,12 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case // logout $crawler = $this->request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout'); + $this->assert_response_success(); $this->assertContains($this->lang('LOGOUT_REDIRECT'), $crawler->filter('#message')->text()); // look for a register link, which should be visible only when logged out $crawler = $this->request('GET', 'index.php'); + $this->assert_response_success(); $this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text()); } } -- cgit v1.2.1 From ff993ba9d30f5de49e5231647c5bb76d95c357f8 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 6 Dec 2012 23:47:19 -0500 Subject: [ticket/10972] Drop user deletion. Users should not be deleted in tests that test user creation. Tests should use unique user names to avoid collisions. User deletion should use user_remove anyway. PHPBB3-10972 --- tests/functional/auth_test.php | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/functional/auth_test.php') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index 3e218ebd77..662b1bd38b 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -29,7 +29,6 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case $crawler = $this->request('GET', 'index.php'); $this->assert_response_success(); $this->assertContains('anothertestuser', $crawler->filter('.icon-logout')->text()); - $this->delete_user('anothertestuser'); } /** -- cgit v1.2.1 From ff83580af1af7623012843c56fba605ec2ad7df1 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 15 Dec 2012 13:45:33 -0500 Subject: [ticket/10758] Add a test for acp login. PHPBB3-10758 --- tests/functional/auth_test.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/functional/auth_test.php') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index 662b1bd38b..f92a4a2210 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -49,4 +49,15 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case $this->assert_response_success(); $this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text()); } + + public function test_acp_login() + { + $this->login(); + $this->admin_login(); + + // check that we are logged in + $crawler = $this->request('GET', 'adm/index.php?sid=' . $this->sid); + $this->assert_response_success(); + $this->assertContains($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text()); + } } -- cgit v1.2.1 From e77c8ee4ef745e69e7af06b69b3abd7412704b2f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 27 May 2013 22:12:50 +0200 Subject: [ticket/11568] Remove manual calls to assert_response_success() PHPBB3-11568 --- tests/functional/auth_test.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'tests/functional/auth_test.php') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index 662b1bd38b..a0c909e798 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -18,7 +18,6 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case // check for logout link $crawler = $this->request('GET', 'index.php'); - $this->assert_response_success(); $this->assertContains($this->lang('LOGOUT_USER', 'admin'), $crawler->filter('.navbar')->text()); } @@ -27,7 +26,6 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case $this->create_user('anothertestuser'); $this->login('anothertestuser'); $crawler = $this->request('GET', 'index.php'); - $this->assert_response_success(); $this->assertContains('anothertestuser', $crawler->filter('.icon-logout')->text()); } @@ -41,12 +39,10 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case // logout $crawler = $this->request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout'); - $this->assert_response_success(); $this->assertContains($this->lang('LOGOUT_REDIRECT'), $crawler->filter('#message')->text()); // look for a register link, which should be visible only when logged out $crawler = $this->request('GET', 'index.php'); - $this->assert_response_success(); $this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text()); } } -- 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/auth_test.php | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/functional/auth_test.php') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index 8359bbe8ea..06dc26dfeb 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -53,7 +53,6 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case // check that we are logged in $crawler = $this->request('GET', 'adm/index.php?sid=' . $this->sid); - $this->assert_response_success(); $this->assertContains($this->lang('ADMIN_PANEL'), $crawler->filter('h1')->text()); } } -- cgit v1.2.1 From b7b81f64316a900d6de308d4b65f89b7b4b58e2f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 31 May 2013 16:16:41 +0200 Subject: [ticket/11568] Use static calls for static methods PHPBB3-11568 --- tests/functional/auth_test.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/functional/auth_test.php') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index a0c909e798..afb4f15fc2 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -17,7 +17,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case $this->login(); // check for logout link - $crawler = $this->request('GET', 'index.php'); + $crawler = self::request('GET', 'index.php'); $this->assertContains($this->lang('LOGOUT_USER', 'admin'), $crawler->filter('.navbar')->text()); } @@ -25,7 +25,7 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case { $this->create_user('anothertestuser'); $this->login('anothertestuser'); - $crawler = $this->request('GET', 'index.php'); + $crawler = self::request('GET', 'index.php'); $this->assertContains('anothertestuser', $crawler->filter('.icon-logout')->text()); } @@ -38,11 +38,11 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case $this->add_lang('ucp'); // logout - $crawler = $this->request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout'); + $crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout'); $this->assertContains($this->lang('LOGOUT_REDIRECT'), $crawler->filter('#message')->text()); // look for a register link, which should be visible only when logged out - $crawler = $this->request('GET', 'index.php'); + $crawler = self::request('GET', 'index.php'); $this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text()); } } -- cgit v1.2.1 From 8f95ef55a65cbf58e74840957cf9acfaf9e16d31 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 13 Jul 2013 12:27:00 -0400 Subject: [ticket/11685] Remove logout confirmation page PHPBB3-11685 --- tests/functional/auth_test.php | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/functional/auth_test.php') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index ff4d3ced5c..cfd85571b7 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -39,7 +39,6 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case // logout $crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout'); - $this->assertContains($this->lang('LOGOUT_REDIRECT'), $crawler->filter('#message')->text()); // look for a register link, which should be visible only when logged out $crawler = self::request('GET', 'index.php'); -- cgit v1.2.1