ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ApacheTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\DAV\Auth\Backend;
4 
5 use Sabre\HTTP;
6 
8 
9  function testConstruct() {
10 
11  $backend = new Apache();
12  $this->assertInstanceOf('Sabre\DAV\Auth\Backend\Apache', $backend);
13 
14  }
15 
16  function testNoHeader() {
17 
18  $request = new HTTP\Request();
19  $response = new HTTP\Response();
20  $backend = new Apache();
21 
22  $this->assertFalse(
23  $backend->check($request, $response)[0]
24  );
25 
26  }
27 
28  function testRemoteUser() {
29 
31  'REMOTE_USER' => 'username',
32  ]);
33  $response = new HTTP\Response();
34  $backend = new Apache();
35 
36  $this->assertEquals(
37  [true, 'principals/username'],
38  $backend->check($request, $response)
39  );
40 
41  }
42 
44 
46  'REDIRECT_REMOTE_USER' => 'username',
47  ]);
48  $response = new HTTP\Response();
49  $backend = new Apache();
50 
51  $this->assertEquals(
52  [true, 'principals/username'],
53  $backend->check($request, $response)
54  );
55 
56  }
57 
58  function testRequireAuth() {
59 
60  $request = new HTTP\Request();
61  $response = new HTTP\Response();
62 
63  $backend = new Apache();
64  $backend->challenge($request, $response);
65 
66  $this->assertNull(
67  $response->getHeader('WWW-Authenticate')
68  );
69 
70  }
71 }
Apache authenticator.
Definition: Apache.php:20
foreach($paths as $path) $request
Definition: asyncclient.php:32
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition: Sapi.php:107
$response