Changeset View
Changeset View
Standalone View
Standalone View
src/parser/__tests__/PhutilJSONParserTestCase.php
Show All 16 Lines | $tests = array( | ||||
=> array('foo' => 'bar', 'bar' => array('baz' => 'foo')), | => array('foo' => 'bar', 'bar' => array('baz' => 'foo')), | ||||
'{"": ""}' => array('' => ''), | '{"": ""}' => array('' => ''), | ||||
'{"test":"\u00c9v\u00e9nement"}' | '{"test":"\u00c9v\u00e9nement"}' | ||||
=> array('test' => "\xC3\x89v\xC3\xA9nement"), | => array('test' => "\xC3\x89v\xC3\xA9nement"), | ||||
'["\u00c9v\u00e9nement"]' => array("\xC3\x89v\xC3\xA9nement"), | '["\u00c9v\u00e9nement"]' => array("\xC3\x89v\xC3\xA9nement"), | ||||
'{"test":"http:\/\/foo\\\\zomg"}' | '{"test":"http:\/\/foo\\\\zomg"}' | ||||
=> array('test' => 'http://foo\\zomg'), | => array('test' => 'http://foo\\zomg'), | ||||
'["http:\/\/foo\\\\zomg"]' => array('http://foo\\zomg'), | '["http:\/\/foo\\\\zomg"]' => array('http://foo\\zomg'), | ||||
Filesystem::readFile(dirname(__FILE__).'/json/base64.json') => array( | Filesystem::readFile(__DIR__.'/json/base64.json') => array( | ||||
'action' => 'candidate.create', | 'action' => 'candidate.create', | ||||
'actionId' => '80653a26cc46357ff79ff83b47e27c3cb7a668bd', | 'actionId' => '80653a26cc46357ff79ff83b47e27c3cb7a668bd', | ||||
'params' => array( | 'params' => array( | ||||
'attachments' => array( | 'attachments' => array( | ||||
Filesystem::readFile(dirname(__FILE__).'/json/base64.data'), | Filesystem::readFile(__DIR__.'/json/base64.data'), | ||||
), | ), | ||||
), | ), | ||||
), | ), | ||||
); | ); | ||||
foreach ($tests as $input => $expect) { | foreach ($tests as $input => $expect) { | ||||
$this->assertEqual( | $this->assertEqual( | ||||
$expect, | $expect, | ||||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0