ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
ApacheTest.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Sabre\DAV\Auth\Backend
;
4
5
use
Sabre\HTTP
;
6
7
class
ApacheTest
extends
\PHPUnit_Framework_TestCase
{
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
30
$request
=
HTTP\Sapi::createFromServerArray
([
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
43
function
testRedirectRemoteUser
() {
44
45
$request
=
HTTP\Sapi::createFromServerArray
([
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
}
Sabre\DAV\Auth\Backend\Apache
Apache authenticator.
Definition:
Apache.php:20
Sabre\DAV\Auth\Backend\ApacheTest\testNoHeader
testNoHeader()
Definition:
ApacheTest.php:16
$request
foreach($paths as $path) $request
Definition:
asyncclient.php:32
Sabre\DAV\Auth\Backend\ApacheTest\testRemoteUser
testRemoteUser()
Definition:
ApacheTest.php:28
Sabre\HTTP
Definition:
ResponseMock.php:3
PHPUnit_Framework_TestCase
Sabre\DAV\Auth\Backend\ApacheTest\testRedirectRemoteUser
testRedirectRemoteUser()
Definition:
ApacheTest.php:43
Sabre\DAV\Auth\Backend
Definition:
AbstractBasic.php:3
Sabre\DAV\Auth\Backend\ApacheTest\testConstruct
testConstruct()
Definition:
ApacheTest.php:9
Sabre\DAV\Auth\Backend\ApacheTest\testRequireAuth
testRequireAuth()
Definition:
ApacheTest.php:58
Sabre\DAV\Auth\Backend\ApacheTest
Definition:
ApacheTest.php:7
php
Sabre\HTTP\Sapi\createFromServerArray
static createFromServerArray(array $serverArray)
This static method will create a new Request object, based on a PHP $_SERVER array.
Definition:
Sapi.php:107
$response
$response
Definition:
proxy_ylocal.php:39
libs
composer
vendor
sabre
dav
tests
Sabre
DAV
Auth
Backend
ApacheTest.php
Generated on Thu Jan 30 2025 19:01:29 for ILIAS by
1.8.13 (using
Doxyfile
)