From 6b057e026cfb9603c6260d619e0a37e3679aa0d5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 30 Oct 2014 13:58:09 +0100 Subject: [ticket/13248] Use auth provider collection for getting provider PHPBB3-13248 --- tests/functional/auth_test.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index b4b4279bf1..1794afd009 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -33,6 +33,30 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case $this->assertContains('anothertestuser', $crawler->filter('#username_logged_in')->text()); } + /** + * @dependsOn test_login_other + */ + public function test_login_ucp_other_auth_provider() + { + global $cache, $config; + $cache = new phpbb_mock_null_cache; + $db = $this->get_db(); + $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'foobar' WHERE config_name = 'auth_method'"; + $db->sql_query($sql); + $crawler = self::request('GET', 'ucp.php?mode=login'); + $form = $crawler->selectButton('Login')->form(); + $form->setValues(array( + 'username' => 'anothertestuser', + 'password' => str_repeat('anothertestuser', 2), + )); + $config['auth_method'] = 'foobar'; + $crawler = self::submit($form); + $this->assertContains('anothertestuser', $crawler->filter('#username_logged_in')->text()); + $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'db' WHERE config_name = 'auth_method'"; + $db->sql_query($sql); + $config['auth_method'] = 'db'; + } + /** * @depends test_login */ -- cgit v1.2.1 From 8aec6b58e087fa86c71baaccbeb07fe7a495aee5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 30 Oct 2014 20:52:14 +0100 Subject: [ticket/13248] Use functional framework login method in tests PHPBB3-13248 --- tests/functional/auth_test.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php index 1794afd009..76e1709afb 100644 --- a/tests/functional/auth_test.php +++ b/tests/functional/auth_test.php @@ -43,14 +43,9 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case $db = $this->get_db(); $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'foobar' WHERE config_name = 'auth_method'"; $db->sql_query($sql); - $crawler = self::request('GET', 'ucp.php?mode=login'); - $form = $crawler->selectButton('Login')->form(); - $form->setValues(array( - 'username' => 'anothertestuser', - 'password' => str_repeat('anothertestuser', 2), - )); $config['auth_method'] = 'foobar'; - $crawler = self::submit($form); + $this->login('anothertestuser'); + $crawler = self::request('GET', 'index.php'); $this->assertContains('anothertestuser', $crawler->filter('#username_logged_in')->text()); $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'db' WHERE config_name = 'auth_method'"; $db->sql_query($sql); -- cgit v1.2.1