aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auth/provider_apache_test.php
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-06-25 14:24:47 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-06-25 14:25:45 -0400
commit9e04328545c933aa801c52c1567efd3d2e06fcf3 (patch)
tree15fe69ce3b88c6a4bbd1b906eb0d84d239d66f8f /tests/auth/provider_apache_test.php
parent307dd9777b67e8a7628bb74eeba8cc55ab6a8f58 (diff)
downloadforums-9e04328545c933aa801c52c1567efd3d2e06fcf3.tar
forums-9e04328545c933aa801c52c1567efd3d2e06fcf3.tar.gz
forums-9e04328545c933aa801c52c1567efd3d2e06fcf3.tar.bz2
forums-9e04328545c933aa801c52c1567efd3d2e06fcf3.tar.xz
forums-9e04328545c933aa801c52c1567efd3d2e06fcf3.zip
[feature/auth-refactor] Test autologin() on provider_apache
Provides a test for the autologin() method of provider_apache that assumes the user already exists in the database. PHPBB3-9734
Diffstat (limited to 'tests/auth/provider_apache_test.php')
-rw-r--r--tests/auth/provider_apache_test.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php
index 4773e4fdc3..6cfd676fc2 100644
--- a/tests/auth/provider_apache_test.php
+++ b/tests/auth/provider_apache_test.php
@@ -69,6 +69,34 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->assertEquals($expected, $this->provider->login($username, $password));
}
+ public function test_autologin()
+ {
+ $this->request->overwrite('PHP_AUTH_USER', 'foobar', phpbb_request_interface::SERVER);
+ $this->request->overwrite('PHP_AUTH_PW', 'example', phpbb_request_interface::SERVER);
+
+ $expected = array(
+ 'status' => LOGIN_SUCCESS,
+ 'error_msg' => false,
+ 'user_row' => array(
+ 'user_id' => '1',
+ 'username' => 'foobar',
+ 'username_clean' => 'foobar',
+ 'user_password' => '$H$9E45lK6J8nLTSm9oJE5aNCSTFK9wqa/',
+ 'user_passchg' => '0',
+ 'user_pass_convert' => '0',
+ 'user_email' => 'example@example.com',
+ 'user_type' => '0',
+ 'user_login_attempts' => '0',
+ 'user_permission' => '',
+ 'user_sig' => '',
+ 'user_occ' => '',
+ 'user_interests' => '',
+ ),
+ );
+
+ $this->assertEquals($expected, $this->provider->autologin());
+ }
+
public function test_validate_session()
{
$this->markTestIncomplete();