Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function testFormat() |
||
11 | { |
||
12 | $unformattedXml = '<?xml version="1.0" encoding="UTF-8"?><root><child1>123</child1><child2 attribute="1"><subchild1>456</subchild1></child2></root>'; |
||
13 | |||
14 | $expectedFormattedXml = <<<EOF |
||
15 | <?xml version="1.0" encoding="UTF-8"?> |
||
16 | <root> |
||
17 | <child1>123</child1> |
||
18 | <child2 attribute="1"> |
||
19 | <subchild1>456</subchild1> |
||
20 | </child2> |
||
21 | </root> |
||
22 | |||
23 | EOF; |
||
24 | |||
25 | $xmlFormatter = new XmlFormatter(); |
||
26 | $formattedXml = $xmlFormatter->format($unformattedXml); |
||
27 | |||
28 | $this->assertEquals($expectedFormattedXml, $formattedXml); |
||
29 | } |
||
31 |