public function testOffset() { $offsets = array('' => null, '' => array('offset' => ' ', 'depth' => 0), "\n " => array('offset' => ' ', 'depth' => 1), "\n x x" => array('offset' => ' x', 'depth' => 2)); foreach ($offsets as $expected => $test) { $this->assertEquals($expected, Encoder::offset($test)); } }