Definition at line 8 of file XmlFragmentTest.php.
◆ testDeserialize()
Sabre\Xml\Element\XmlFragmentTest::testDeserialize |
( |
|
$input, |
|
|
|
$expected |
|
) |
| |
xmlProvider
Definition at line 13 of file XmlFragmentTest.php.
References $input, Sabre\VObject\$output, and $reader.
17 <root xmlns=
"http://sabredav.org/ns">
18 <fragment>
$input</fragment>
24 '{http://sabredav.org/ns}fragment' =>
'Sabre\\Xml\\Element\\XmlFragment',
31 'name' =>
'{http://sabredav.org/ns}root',
34 'name' =>
'{http://sabredav.org/ns}fragment',
35 'value' =>
new XmlFragment($expected),
◆ testSerialize()
Sabre\Xml\Element\XmlFragmentTest::testSerialize |
( |
|
$expectedFallback, |
|
|
|
$input, |
|
|
|
$expected = null |
|
) |
| |
xmlProvider
Definition at line 113 of file XmlFragmentTest.php.
References $input, and Sabre\VObject\$output.
115 if (is_null($expected)) {
116 $expected = $expectedFallback;
119 $writer =
new Writer();
120 $writer->namespaceMap = [
121 'http://sabredav.org/ns' => null
123 $writer->openMemory();
124 $writer->startDocument(
'1.0');
127 '{http://sabredav.org/ns}root' => [
128 '{http://sabredav.org/ns}fragment' =>
new XmlFragment(
$input),
132 $output = $writer->outputMemory();
135 <?xml version=
"1.0"?>
136 <root xmlns=
"http://sabredav.org/ns"><fragment>$expected</fragment></root>
139 $this->assertEquals($expected,
$output);
◆ xmlProvider()
Sabre\Xml\Element\XmlFragmentTest::xmlProvider |
( |
| ) |
|
Data provider for serialize and deserialize tests.
Returns three items per test:
- Input data for the reader.
- Expected output for XmlFragment deserializer
- Expected output after serializing that value again.
If 3 is not set, use 1 for 3.
- Returns
- void
Definition at line 57 of file XmlFragmentTest.php.
65 '<element>hello</element>',
66 '<element xmlns="http://sabredav.org/ns">hello</element>' 69 '<element foo="bar">hello</element>',
70 '<element xmlns="http://sabredav.org/ns" foo="bar">hello</element>' 73 '<element x1:foo="bar" xmlns:x1="http://example.org/ns">hello</element>',
74 '<element xmlns:x1="http://example.org/ns" xmlns="http://sabredav.org/ns" x1:foo="bar">hello</element>' 77 '<element xmlns="http://example.org/ns">hello</element>',
78 '<element xmlns="http://example.org/ns">hello</element>',
79 '<x1:element xmlns:x1="http://example.org/ns">hello</x1:element>',
82 '<element xmlns:foo="http://example.org/ns">hello</element>',
83 '<element xmlns:foo="http://example.org/ns" xmlns="http://sabredav.org/ns">hello</element>',
84 '<element>hello</element>',
87 '<foo:element xmlns:foo="http://example.org/ns">hello</foo:element>',
88 '<foo:element xmlns:foo="http://example.org/ns">hello</foo:element>',
89 '<x1:element xmlns:x1="http://example.org/ns">hello</x1:element>',
92 '<foo:element xmlns:foo="http://example.org/ns"><child>hello</child></foo:element>',
93 '<foo:element xmlns:foo="http://example.org/ns" xmlns="http://sabredav.org/ns"><child>hello</child></foo:element>',
94 '<x1:element xmlns:x1="http://example.org/ns"><child>hello</child></x1:element>',
97 '<foo:element xmlns:foo="http://example.org/ns"><child/></foo:element>',
98 '<foo:element xmlns:foo="http://example.org/ns" xmlns="http://sabredav.org/ns"><child/></foo:element>',
99 '<x1:element xmlns:x1="http://example.org/ns"><child/></x1:element>',
102 '<foo:element xmlns:foo="http://example.org/ns"><child a="b"/></foo:element>',
103 '<foo:element xmlns:foo="http://example.org/ns" xmlns="http://sabredav.org/ns"><child a="b"/></foo:element>',
104 '<x1:element xmlns:x1="http://example.org/ns"><child a="b"/></x1:element>',
The documentation for this class was generated from the following file: