Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1726740
ApacheTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Size
1 KB
Subscribers
None
ApacheTest.php
View Options
<?php
namespace
Sabre\DAV\Auth\Backend
;
use
Sabre\DAV
;
use
Sabre\HTTP
;
class
ApacheTest
extends
\PHPUnit_Framework_TestCase
{
function
testConstruct
()
{
$backend
=
new
Apache
();
$this
->
assertInstanceOf
(
'Sabre
\D
AV
\A
uth
\B
ackend
\A
pache'
,
$backend
);
}
function
testNoHeader
()
{
$request
=
new
HTTP\Request
();
$response
=
new
HTTP\Response
();
$backend
=
new
Apache
();
$this
->
assertFalse
(
$backend
->
check
(
$request
,
$response
)[
0
]
);
}
function
testRemoteUser
()
{
$request
=
HTTP\Sapi
::
createFromServerArray
([
'REMOTE_USER'
=>
'username'
,
]);
$response
=
new
HTTP\Response
();
$backend
=
new
Apache
();
$this
->
assertEquals
(
[
true
,
'principals/username'
],
$backend
->
check
(
$request
,
$response
)
);
}
function
testRedirectRemoteUser
()
{
$request
=
HTTP\Sapi
::
createFromServerArray
([
'REDIRECT_REMOTE_USER'
=>
'username'
,
]);
$response
=
new
HTTP\Response
();
$backend
=
new
Apache
();
$this
->
assertEquals
(
[
true
,
'principals/username'
],
$backend
->
check
(
$request
,
$response
)
);
}
function
testRequireAuth
()
{
$request
=
new
HTTP\Request
();
$response
=
new
HTTP\Response
();
$backend
=
new
Apache
();
$backend
->
challenge
(
$request
,
$response
);
$this
->
assertNull
(
$response
->
getHeader
(
'WWW-Authenticate'
)
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Dec 5, 3:40 PM (19 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
913603
Default Alt Text
ApacheTest.php (1 KB)
Attached To
rDAVCAL DokuWiki DAVCal PlugIn
Event Timeline
Log In to Comment