Page MenuHomePhabricator

Add unit tests for FormatJson against native PHP json_encode() and json_decode()
Closed, ResolvedPublic

Description

Suggested is to
"... use some tests to make sure that the output from Services_Json and json_{en,de}code are identical."

Enhancement bug filed for an issue in the mailinglist discussion "[Wikitech-l] Re quests about log system":

  • json in php requires a mess of code and potentially a 3rd party

libraries because:

  • the bulit-in json json_{en,de}code library functions may not be installed
  • the bulit-in json library in some cases actually has a bug that makes

it encode/decode json incorrectly

Well, that's why we have the FormatJson wrapper. Could use some tests
to make sure that the output from Services_Json and json_{en,de}code
are identical. I'm whipping up some trivial ones now.

[1] http://article.gmane.org/gmane.science.linguistics.wikipedia.technical/55429


Version: unspecified
Severity: enhancement
URL: http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/json/

Details

Reference
bz30841

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:52 PM
bzimport set Reference to bz30841.
bzimport added a subscriber: Unknown Object (MLST).

I already wrote some initial tests in r96713. Feel free to add more if you'd like :)