| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | function it_writes_an_item(\XmlWriter $xmlWriter) |
||
| 27 | { |
||
| 28 | $xmlWriter->openUri('file')->shouldBeCalled(); |
||
| 29 | $xmlWriter->startDocument('1.0', 'UTF-8')->shouldBeCalled(); |
||
| 30 | $xmlWriter->startElement('elements')->shouldBeCalled(); |
||
| 31 | $xmlWriter->startElement('element')->shouldBeCalledTimes(2); |
||
| 32 | $xmlWriter->writeElement('key1', 'value1')->shouldBeCalled(); |
||
| 33 | $xmlWriter->writeElement('key2', 'value2')->shouldBeCalled(); |
||
| 34 | $xmlWriter->endElement()->shouldBeCalledTimes(3); |
||
| 35 | $xmlWriter->endDocument()->shouldBeCalled(); |
||
| 36 | $xmlWriter->flush()->shouldBeCalled(); |
||
| 37 | |||
| 38 | $this->prepare(); |
||
| 39 | |||
| 40 | $this->writeItem(['key1' => 'value1']); |
||
| 41 | $this->writeItem(['key2' => 'value2']); |
||
| 42 | |||
| 43 | $this->finish(); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |