예제 #1
0
 function testRedirectRemoteUser()
 {
     $backend = new Apache();
     $server = new DAV\Server();
     $request = HTTP\Sapi::createFromServerArray(['REDIRECT_REMOTE_USER' => 'username']);
     $server->httpRequest = $request;
     $this->assertTrue($backend->authenticate($server, 'Realm'));
     $userInfo = 'username';
     $this->assertEquals($userInfo, $backend->getCurrentUser());
 }
예제 #2
0
 function testRemoteUser()
 {
     $backend = new Apache();
     $server = new DAV\Server();
     $request = new HTTP\Request(array('REMOTE_USER' => 'username'));
     $server->httpRequest = $request;
     $this->assertTrue($backend->authenticate($server, 'Realm'));
     $userInfo = 'username';
     $this->assertEquals($userInfo, $backend->getCurrentUser());
 }