]> git.mxchange.org Git - friendica-addons.git/blob - dav/SabreDAV/tests/Sabre/DAV/Auth/Backend/ApacheTest.php
Merge branch '3.6-release'
[friendica-addons.git] / dav / SabreDAV / tests / Sabre / DAV / Auth / Backend / ApacheTest.php
1 <?php
2
3 class Sabre_DAV_Auth_Backend_ApacheTest extends PHPUnit_Framework_TestCase {
4
5     function testConstruct() {
6
7         $backend = new Sabre_DAV_Auth_Backend_Apache();
8
9     }
10
11     /**
12      * @expectedException Sabre_DAV_Exception
13      */
14     function testNoHeader() {
15
16         $server = new Sabre_DAV_Server();
17         $backend = new Sabre_DAV_Auth_Backend_Apache();
18         $backend->authenticate($server,'Realm');
19
20     }
21
22     function testRemoteUser() {
23
24         $backend = new Sabre_DAV_Auth_Backend_Apache();
25
26         $server = new Sabre_DAV_Server();
27         $request = new Sabre_HTTP_Request(array(
28             'REMOTE_USER' => 'username',
29         ));
30         $server->httpRequest = $request;
31
32         $this->assertTrue($backend->authenticate($server, 'Realm'));
33
34         $userInfo = 'username';
35
36         $this->assertEquals($userInfo, $backend->getCurrentUser());
37
38     }
39
40 }