Changeset View
Changeset View
Standalone View
Standalone View
src/utils/__tests__/PhutilUtilsTestCase.php
| Show First 20 Lines • Show All 564 Lines • ▼ Show 20 Lines | public function testPhutilJSONDecode() { | ||||
| foreach ($invalid_cases as $input) { | foreach ($invalid_cases as $input) { | ||||
| $caught = null; | $caught = null; | ||||
| try { | try { | ||||
| phutil_json_decode($input); | phutil_json_decode($input); | ||||
| } catch (Exception $ex) { | } catch (Exception $ex) { | ||||
| $caught = $ex; | $caught = $ex; | ||||
| } | } | ||||
| $this->assertTrue($caught instanceof PhutilJSONParserException); | $this->assertTrue($caught instanceof PhutilJSONParserException); | ||||
| } | } | ||||
| } | } | ||||
| public function testPhutilINIDecode() { | public function testPhutilINIDecode() { | ||||
| // Skip the test if we are using an older version of PHP that doesn't | // Skip the test if we are using an older version of PHP that doesn't | ||||
| // have the `parse_ini_string` function. | // have the `parse_ini_string` function. | ||||
| try { | try { | ||||
| ▲ Show 20 Lines • Show All 379 Lines • ▼ Show 20 Lines | public function testNaturalList() { | ||||
| ); | ); | ||||
| foreach ($cases as $case) { | foreach ($cases as $case) { | ||||
| list($expect, $value) = $case; | list($expect, $value) = $case; | ||||
| $this->assertEqual($expect, phutil_is_natural_list($value)); | $this->assertEqual($expect, phutil_is_natural_list($value)); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||