diff --git a/classes/PostFixtures.inc b/classes/PostFixtures.inc index 4f980d5..a706b55 100644 --- a/classes/PostFixtures.inc +++ b/classes/PostFixtures.inc @@ -4,7 +4,7 @@ class PostFixtures { function parse_json($input) { if (($data = json_decode($input)) !== false) { if (is_array($data) || is_object($data)) { - return (array)$data; + return array_values((array)$data); } } return false; diff --git a/test/PostFixturesTest.php b/test/PostFixturesTest.php index b03f1c3..9b90d6f 100644 --- a/test/PostFixturesTest.php +++ b/test/PostFixturesTest.php @@ -17,7 +17,9 @@ class PostFixturesTest extends PHPUnit_Framework_TestCase { array('', false), array('{]', false), array('{}', array()), - array('[]', array()) + array('[]', array()), + array('["test", "test2"]', array('test', 'test2')), + array('{"one": "test", "two": "test2"}', array('test', 'test2')) ); }