public function testFirstKey() { // Array test for array $jsonPath = new JSONPath(array('a' => 'A', 'b', 'B')); $firstKey = $jsonPath->firstKey(); $this->assertEquals('a', $firstKey); // Array test for object $jsonPath = new JSONPath((object) array('a' => 'A', 'b', 'B')); $firstKey = $jsonPath->firstKey(); $this->assertEquals('a', $firstKey); }