From 8cf0b79a4746b416e66264cc3313f46d995b1783 Mon Sep 17 00:00:00 2001 From: David King Date: Mon, 23 Apr 2012 17:16:16 -0400 Subject: [task/functional] Increase code coverage for functional tests PHPBB3-10758 --- tests/functional/auth_test.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/functional/auth_test.php (limited to 'tests/functional/auth_test.php') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php new file mode 100644 index 0000000000..e955dcb4df --- /dev/null +++ b/tests/functional/auth_test.php @@ -0,0 +1,40 @@ +login(); + + // check for logout link + $crawler = $this->request('GET', 'index.php'); + $this->assertContains($this->lang('LOGOUT_USER', 'admin'), $crawler->filter('.navbar')->text()); + } + + /** + * @depends test_login + */ + public function test_logout() + { + $this->login(); + $this->add_lang('ucp'); + + // logout + $crawler = $this->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'); + $this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text()); + } +} -- cgit v1.2.1