public function testEncoding() { $formatter = new JSON(); $data = array('name' => 'Joe', 'age' => 21, 'employed' => true); $options = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : null; $this->assertSame(json_encode($data, $options), $formatter->encode($data)); }