public function testSerialize() { $test = array('en' => 'english', 'fr' => 'french'); $translator = new Translator(); $translator->processInput($test); // test if json serialization is correct $this->assertJsonStringEqualsJsonString(json_encode($test), $translator->serialize()); }