ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
LockedTest.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Sabre\DAV\Exception
;
4
5
use
DOMDocument
;
6
use
Sabre\DAV
;
7
8
class
LockedTest
extends
\PHPUnit_Framework_TestCase
{
9
10
function
testSerialize
() {
11
12
$dom =
new
DOMDocument
(
'1.0'
);
13
$dom->formatOutput =
true
;
14
$root
= $dom->createElement(
'd:root'
);
15
16
$dom->appendChild(
$root
);
17
$root
->setAttribute(
'xmlns:d'
,
'DAV:'
);
18
19
$lockInfo =
new
DAV\Locks\LockInfo
();
20
$lockInfo->uri =
'/foo'
;
21
$locked =
new
Locked($lockInfo);
22
23
$locked->serialize(
new
DAV\
Server
(),
$root
);
24
25
$output
= $dom->saveXML();
26
27
$expected =
'<?xml version="1.0"?>
28
<d:root xmlns:d="DAV:">
29
<d:lock-token-submitted xmlns:d="DAV:">
30
<d:href>/foo</d:href>
31
</d:lock-token-submitted>
32
</d:root>
33
'
;
34
35
$this->assertEquals($expected,
$output
);
36
37
}
38
39
function
testSerializeAmpersand
() {
40
41
$dom =
new
DOMDocument
(
'1.0'
);
42
$dom->formatOutput =
true
;
43
$root
= $dom->createElement(
'd:root'
);
44
45
$dom->appendChild(
$root
);
46
$root
->setAttribute(
'xmlns:d'
,
'DAV:'
);
47
48
$lockInfo =
new
DAV\Locks\LockInfo
();
49
$lockInfo->uri =
'/foo&bar'
;
50
$locked =
new
Locked($lockInfo);
51
52
$locked->serialize(
new
DAV\
Server
(),
$root
);
53
54
$output
= $dom->saveXML();
55
56
$expected =
'<?xml version="1.0"?>
57
<d:root xmlns:d="DAV:">
58
<d:lock-token-submitted xmlns:d="DAV:">
59
<d:href>/foo&bar</d:href>
60
</d:lock-token-submitted>
61
</d:root>
62
'
;
63
64
$this->assertEquals($expected,
$output
);
65
66
}
67
}
Sabre\DAV
DOMDocument
Sabre\DAV\Exception\LockedTest\testSerializeAmpersand
testSerializeAmpersand()
Definition:
LockedTest.php:39
Sabre\VObject\$output
$output
Definition:
mergeduplicates.php:36
PHPUnit_Framework_TestCase
Sabre\DAV\Exception\LockedTest\testSerialize
testSerialize()
Definition:
LockedTest.php:10
Sabre\DAV\Server
Main DAV server class.
Definition:
Server.php:23
$root
$root
Definition:
sabredav.php:45
Sabre\DAV\Locks\LockInfo
LockInfo class.
Definition:
LockInfo.php:15
php
Sabre\DAV\Exception\LockedTest
Definition:
LockedTest.php:8
Sabre\DAV\Exception
Definition:
BadRequest.php:3
libs
composer
vendor
sabre
dav
tests
Sabre
DAV
Exception
LockedTest.php
Generated on Thu Jan 16 2025 19:01:52 for ILIAS by
1.8.13 (using
Doxyfile
)