ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
LocalHrefTest.php
Go to the documentation of this file.
1
<?
php
2
3
namespace
Sabre\DAV\Xml\Property
;
4
5
use
Sabre\DAV
;
6
use
Sabre\DAV\Browser\HtmlOutputHelper
;
7
use
Sabre\DAV\Xml\XmlTest
;
8
9
class
LocalHrefTest
extends
XmlTest
{
10
11
function
testConstruct
() {
12
13
$href =
new
LocalHref
(
'path'
);
14
$this->assertEquals(
'path'
, $href->getHref());
15
16
}
17
18
function
testSerialize
() {
19
20
$href =
new
LocalHref
(
'path'
);
21
$this->assertEquals(
'path'
, $href->getHref());
22
23
$this->contextUri =
'/bla/'
;
24
25
$xml
= $this->
write
([
'{DAV:}anything'
=> $href]);
26
27
$this->assertXmlStringEqualsXmlString(
28
'<?xml version="1.0"?>
29
<d:anything xmlns:d="DAV:"><d:href>/bla/path</d:href></d:anything>
30
'
,
$xml
);
31
32
}
33
function
testSerializeSpace
() {
34
35
$href =
new
LocalHref
(
'path alsopath'
);
36
$this->assertEquals(
'path%20alsopath'
, $href->getHref());
37
38
$this->contextUri =
'/bla/'
;
39
40
$xml
= $this->
write
([
'{DAV:}anything'
=> $href]);
41
42
$this->assertXmlStringEqualsXmlString(
43
'<?xml version="1.0"?>
44
<d:anything xmlns:d="DAV:"><d:href>/bla/path%20alsopath</d:href></d:anything>
45
'
,
$xml
);
46
47
}
48
function
testToHtml
() {
49
50
$href =
new
LocalHref
([
51
'/foo/bar'
,
52
'foo/bar'
,
53
'http://example.org/bar'
54
]);
55
56
$html
=
new
HtmlOutputHelper
(
57
'/base/'
,
58
[]
59
);
60
61
$expected =
62
'<a href="/foo/bar">/foo/bar</a><br />'
.
63
'<a href="/base/foo/bar">/base/foo/bar</a><br />'
.
64
'<a href="http://example.org/bar">http://example.org/bar</a>'
;
65
$this->assertEquals($expected, $href->toHtml(
$html
));
66
67
}
68
69
}
Sabre\DAV
HtmlOutputHelper
Sabre\DAV\Xml\Property\LocalHref
LocalHref property.
Definition:
LocalHref.php:25
Sabre\DAV\Xml\XmlTest
Definition:
XmlTest.php:8
Sabre\DAV\Xml\Property
Definition:
Complex.php:3
Sabre\DAV\Xml\Property\LocalHrefTest\testConstruct
testConstruct()
Definition:
LocalHrefTest.php:11
Sabre\DAV\Xml\Property\LocalHrefTest\testSerializeSpace
testSerializeSpace()
Definition:
LocalHrefTest.php:33
Sabre\DAV\Xml\Property\LocalHrefTest\testSerialize
testSerialize()
Definition:
LocalHrefTest.php:18
Sabre\DAV\Xml\Property\LocalHrefTest\testToHtml
testToHtml()
Definition:
LocalHrefTest.php:48
$xml
$xml
Definition:
fetch_windows_zones.php:11
php
Sabre\DAV\Xml\Property\LocalHrefTest
Definition:
LocalHrefTest.php:9
XmlTest
$html
$html
Definition:
example_001.php:87
Sabre\DAV\Browser\HtmlOutputHelper
This class provides a few utility functions for easily generating HTML for the browser plugin...
Definition:
HtmlOutputHelper.php:16
Sabre\DAV\Xml\XmlTest\write
write($input)
Definition:
XmlTest.php:14
libs
composer
vendor
sabre
dav
tests
Sabre
DAV
Xml
Property
LocalHrefTest.php
Generated on Thu Jan 16 2025 19:01:52 for ILIAS by
1.8.13 (using
Doxyfile
)