| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 13 | public function testObjectToArray() |
||
| 14 | { |
||
| 15 | $object = json_decode( |
||
| 16 | '{ |
||
| 17 | "foo" : "bar", |
||
| 18 | "nested" : { |
||
| 19 | "foo" : "bar" |
||
| 20 | }, |
||
| 21 | "arr" : [1, 2, 3] |
||
| 22 | }' |
||
| 23 | ); |
||
| 24 | |||
| 25 | $expected = array( |
||
| 26 | 'foo' => 'bar', |
||
| 27 | 'nested' => array( |
||
| 28 | 'foo' => 'bar' |
||
| 29 | ), |
||
| 30 | 'arr' => array(1, 2, 3) |
||
| 31 | ); |
||
| 32 | |||
| 33 | $actual = ArrayUtils::objectToArray($object); |
||
| 34 | |||
| 35 | $this->assertEquals($expected, $actual); |
||
| 36 | } |
||
| 37 | |||
| 62 |