ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
AbstractServer.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Sabre\DAV
;
4
5
use
Sabre\HTTP
;
6
7
abstract
class
AbstractServer
extends
\PHPUnit_Framework_TestCase
{
8
12
protected
$response
;
13
protected
$request
;
17
protected
$server
;
18
protected
$tempDir
= SABRE_TEMPDIR;
19
20
function
setUp
() {
21
22
$this->response =
new
HTTP\ResponseMock();
23
$this->server =
new
Server
($this->
getRootNode
());
24
$this->server->sapi =
new
HTTP\SapiMock();
25
$this->server->httpResponse =
$this->response
;
26
$this->server->debugExceptions =
true
;
27
$this->
deleteTree
(SABRE_TEMPDIR,
false
);
28
file_put_contents(SABRE_TEMPDIR .
'/test.txt'
,
'Test contents'
);
29
mkdir(SABRE_TEMPDIR .
'/dir'
);
30
file_put_contents(SABRE_TEMPDIR .
'/dir/child.txt'
,
'Child contents'
);
31
32
33
}
34
35
function
tearDown
() {
36
37
$this->
deleteTree
(SABRE_TEMPDIR,
false
);
38
39
}
40
41
protected
function
getRootNode
() {
42
43
return
new
FS\Directory
(SABRE_TEMPDIR);
44
45
}
46
47
private
function
deleteTree
(
$path
, $deleteRoot =
true
) {
48
49
foreach
(scandir(
$path
) as $node) {
50
51
if
($node ==
'.'
|| $node ==
'.svn'
|| $node ==
'..'
)
continue
;
52
$myPath =
$path
.
'/'
. $node;
53
if
(is_file($myPath)) {
54
unlink($myPath);
55
}
else
{
56
$this->
deleteTree
($myPath);
57
}
58
59
}
60
if
($deleteRoot) rmdir(
$path
);
61
62
}
63
64
}
Sabre\DAV
$path
$path
Definition:
aliased.php:25
Sabre\DAV\AbstractServer\setUp
setUp()
Definition:
AbstractServer.php:20
Sabre\DAV\AbstractServer\$response
$response
Definition:
AbstractServer.php:12
Sabre\DAV\AbstractServer\$tempDir
$tempDir
Definition:
AbstractServer.php:18
Sabre\DAV\AbstractServer\tearDown
tearDown()
Definition:
AbstractServer.php:35
Sabre\HTTP
Definition:
ResponseMock.php:3
PHPUnit_Framework_TestCase
Sabre\DAV\AbstractServer\$request
$request
Definition:
AbstractServer.php:13
Sabre\DAV\AbstractServer\getRootNode
getRootNode()
Definition:
AbstractServer.php:41
Sabre\DAV\Server
Main DAV server class.
Definition:
Server.php:23
Sabre\DAV\AbstractServer\deleteTree
deleteTree($path, $deleteRoot=true)
Definition:
AbstractServer.php:47
Sabre\DAV\FS\Directory
Directory class.
Definition:
Directory.php:14
Sabre\DAV\AbstractServer
Definition:
AbstractServer.php:7
php
Sabre\DAV\AbstractServer\$server
$server
Definition:
AbstractServer.php:17
libs
composer
vendor
sabre
dav
tests
Sabre
DAV
AbstractServer.php
Generated on Thu Jan 16 2025 19:01:52 for ILIAS by
1.8.13 (using
Doxyfile
)