| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | public function testSimple() |
||
| 8 | { |
||
| 9 | $reader = new XmlReader(new \SplFileObject('tests/metadata/testfiles/hierarchicaldata-xml.xml')); |
||
| 10 | |||
| 11 | $this->assertEquals(2, count($reader)); |
||
| 12 | $this->assertEquals(array('attr1'), $reader->getFields()); |
||
| 13 | $this->assertEquals(array('value1'=>'1', '@attributes'=>array('attr1'=>'a')), $reader->current()); |
||
| 14 | |||
| 15 | $actualData = array(); |
||
| 16 | $expectedData = array( |
||
| 17 | array('value1'=>'1', '@attributes'=>array('attr1'=>'a')), |
||
| 18 | array('value1'=>'2', '@attributes'=>array('attr2'=>'b')) |
||
| 19 | ); |
||
| 20 | foreach ($reader as $key=>$row) { |
||
| 21 | $actualData[] = $row; |
||
| 22 | } |
||
| 23 | $this->assertEquals($expectedData, $actualData); |
||
| 24 | } |
||
| 25 | |||
| 45 |