Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function testSimpleFunctionality() |
||
12 | { |
||
13 | $input = array( |
||
14 | 'jos , 1 , m', |
||
15 | 'piet , 120, m', |
||
16 | 'tutu le wallon , 50 , f', |
||
17 | ); |
||
18 | $template = |
||
19 | '<name > age, g'; |
||
20 | $names = array('g' => 'gender'); |
||
21 | $result = iterator_to_array(FixedLengthFormattedStringIterator::newFromTemplate($input, $template, $names, array('trim' => ' '))); |
||
22 | $this->assertEquals('jos', $result[0]['name']); |
||
23 | $this->assertEquals('120', $result[1]['age']); |
||
24 | $this->assertEquals('m', $result[1]['gender']); |
||
25 | } |
||
26 | |||
42 |