/** * Method to test jsonSerialize(). * * @return void * * @covers Windwalker\Data\DataSet::jsonSerialize */ public function testJsonSerialize() { if (version_compare(PHP_VERSION, '5.4', '>')) { $json = json_encode($this->instance); } else { $json = json_encode((array) $this->instance->getIterator()); } $this->assertJsonStringEqualsJsonString('[{"flower":"sakura"},{"wind":"walker"}]', $json); }