Definition at line 5 of file ServiceTest.php.
◆ testExpect()
Sabre\Xml\ServiceTest::testExpect |
( |
| ) |
|
testGetReader
Definition at line 102 of file ServiceTest.php.
References $result, and $xml.
105 <root xmlns=
"http://sabre.io/ns">
109 $util =
new Service();
110 $result = $util->expect(
'{http://sabre.io/ns}root',
$xml);
114 'name' =>
'{http://sabre.io/ns}child',
◆ testExpectStream()
Sabre\Xml\ServiceTest::testExpectStream |
( |
| ) |
|
◆ testExpectWrong()
Sabre\Xml\ServiceTest::testExpectWrong |
( |
| ) |
|
testGetReader
Definition at line 162 of file ServiceTest.php.
References $xml.
165 <root xmlns=
"http://sabre.io/ns">
169 $util =
new Service();
170 $util->expect(
'{http://sabre.io/ns}error',
$xml);
◆ testGetReader()
Sabre\Xml\ServiceTest::testGetReader |
( |
| ) |
|
Definition at line 7 of file ServiceTest.php.
References $reader.
10 '{http://sabre.io/ns}test' =>
'Test!',
13 $util =
new Service();
14 $util->elementMap = $elems;
17 $this->assertInstanceOf(
'Sabre\\Xml\\Reader',
$reader);
18 $this->assertEquals($elems,
$reader->elementMap);
◆ testGetWriter()
Sabre\Xml\ServiceTest::testGetWriter |
( |
| ) |
|
Definition at line 22 of file ServiceTest.php.
25 'http://sabre.io/ns' =>
's',
28 $util =
new Service();
29 $util->namespaceMap = $ns;
31 $writer = $util->getWriter();
32 $this->assertInstanceOf(
'Sabre\\Xml\\Writer', $writer);
33 $this->assertEquals($ns, $writer->namespaceMap);
◆ testMapValueObject()
Sabre\Xml\ServiceTest::testMapValueObject |
( |
| ) |
|
Definition at line 201 of file ServiceTest.php.
References $input.
204 <?xml version=
"1.0"?>
205 <order xmlns=
"http://sabredav.org/ns">
207 <amount>99.99</amount>
208 <description>black friday deal</description>
211 <label>processed</label>
217 $ns =
'http://sabredav.org/ns';
218 $orderService = new \Sabre\Xml\Service();
219 $orderService->mapValueObject(
'{' . $ns .
'}order',
'Sabre\Xml\Order');
220 $orderService->mapValueObject(
'{' . $ns .
'}status',
'Sabre\Xml\OrderStatus');
221 $orderService->namespaceMap[$ns] = null;
223 $order = $orderService->parse(
$input);
224 $expected =
new Order();
225 $expected->id = 1234;
226 $expected->amount = 99.99;
227 $expected->description =
'black friday deal';
228 $expected->status =
new OrderStatus();
229 $expected->status->id = 5;
230 $expected->status->label =
'processed';
232 $this->assertEquals($expected, $order);
234 $writtenXml = $orderService->writeValueObject($order);
235 $this->assertEquals(
$input, $writtenXml);
◆ testMapValueObjectArrayProperty()
Sabre\Xml\ServiceTest::testMapValueObjectArrayProperty |
( |
| ) |
|
Definition at line 238 of file ServiceTest.php.
References $input, and ILIAS\FileDelivery\http().
241 <?xml version=
"1.0"?>
242 <order xmlns=
"http://sabredav.org/ns">
244 <amount>99.99</amount>
245 <description>black friday deal</description>
248 <label>processed</label>
256 $ns =
'http://sabredav.org/ns';
257 $orderService = new \Sabre\Xml\Service();
258 $orderService->mapValueObject(
'{' . $ns .
'}order',
'Sabre\Xml\Order');
259 $orderService->mapValueObject(
'{' . $ns .
'}status',
'Sabre\Xml\OrderStatus');
260 $orderService->namespaceMap[$ns] = null;
262 $order = $orderService->parse(
$input);
263 $expected =
new Order();
264 $expected->id = 1234;
265 $expected->amount = 99.99;
266 $expected->description =
'black friday deal';
267 $expected->status =
new OrderStatus();
268 $expected->status->id = 5;
269 $expected->status->label =
'processed';
270 $expected->link = [
'http://example.org/',
'http://example.com/'];
272 $this->assertEquals($expected, $order);
274 $writtenXml = $orderService->writeValueObject($order);
275 $this->assertEquals(
$input, $writtenXml);
static http()
Fetches the global http state from ILIAS.
◆ testParse()
Sabre\Xml\ServiceTest::testParse |
( |
| ) |
|
testGetReader
Definition at line 40 of file ServiceTest.php.
References $result, and $xml.
43 <root xmlns=
"http://sabre.io/ns">
47 $util =
new Service();
49 $this->assertEquals(
'{http://sabre.io/ns}root', $rootElement);
53 'name' =>
'{http://sabre.io/ns}child',
◆ testParseClarkNotation()
Sabre\Xml\ServiceTest::testParseClarkNotation |
( |
| ) |
|
◆ testParseClarkNotationFail()
Sabre\Xml\ServiceTest::testParseClarkNotationFail |
( |
| ) |
|
◆ testParseStream()
Sabre\Xml\ServiceTest::testParseStream |
( |
| ) |
|
testGetReader
Definition at line 69 of file ServiceTest.php.
References $result, GuzzleHttp\Psr7\$stream, and $xml.
72 <root xmlns=
"http://sabre.io/ns">
80 $util =
new Service();
82 $this->assertEquals(
'{http://sabre.io/ns}root', $rootElement);
86 'name' =>
'{http://sabre.io/ns}child',
$stream
PHP stream implementation.
◆ testWrite()
Sabre\Xml\ServiceTest::testWrite |
( |
| ) |
|
testGetWriter
Definition at line 177 of file ServiceTest.php.
References $result.
179 $util =
new Service();
180 $util->namespaceMap = [
181 'http://sabre.io/ns' =>
's',
183 $result = $util->write(
'{http://sabre.io/ns}root', [
184 '{http://sabre.io/ns}child' =>
'value',
188 <?xml version=
"1.0"?>
189 <
s:root xmlns:
s=
"http://sabre.io/ns">
190 <
s:child>value</
s:child>
◆ testWriteVoNotFound()
Sabre\Xml\ServiceTest::testWriteVoNotFound |
( |
| ) |
|
Definition at line 281 of file ServiceTest.php.
283 $service =
new Service();
284 $service->writeValueObject(
new \StdClass());
The documentation for this class was generated from the following file: