ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SupportedMethodSetTest.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\DAV\Xml\Property;
4 
6 
8 
9  function testSimple() {
10 
11  $cus = new SupportedMethodSet(['GET', 'PUT']);
12  $this->assertEquals(['GET', 'PUT'], $cus->getValue());
13 
14  $this->assertTrue($cus->has('GET'));
15  $this->assertFalse($cus->has('HEAD'));
16 
17  }
18 
19  function testSerialize() {
20 
21  $cus = new SupportedMethodSet(['GET', 'PUT']);
22  $xml = $this->write(['{DAV:}foo' => $cus]);
23 
24  $expected = '<?xml version="1.0"?>
25 <d:foo xmlns:d="DAV:">
26  <d:supported-method name="GET"/>
27  <d:supported-method name="PUT"/>
28 </d:foo>';
29 
30  $this->assertXmlStringEqualsXmlString($expected, $xml);
31 
32  }
33 
34  function testSerializeHtml() {
35 
36  $cus = new SupportedMethodSet(['GET', 'PUT']);
37  $result = $cus->toHtml(
38  new \Sabre\DAV\Browser\HtmlOutputHelper('/', [])
39  );
40 
41  $this->assertEquals('GET, PUT', $result);
42 
43  }
44 
45 }
$result
This class provides a few utility functions for easily generating HTML for the browser plugin...