Changeset View
Changeset View
Standalone View
Standalone View
src/utils/__tests__/PhutilUtilsTestCase.php
| Show First 20 Lines • Show All 771 Lines • ▼ Show 20 Lines | foreach ($invalid as $input) { | ||||
| } catch (Exception $ex) { | } catch (Exception $ex) { | ||||
| $caught = $ex; | $caught = $ex; | ||||
| } | } | ||||
| $this->assertTrue($caught instanceof InvalidArgumentException); | $this->assertTrue($caught instanceof InvalidArgumentException); | ||||
| } | } | ||||
| } | } | ||||
| public function testJSONEncode() { | |||||
| $in = array( | |||||
| 'example' => "Not Valid UTF8: \x80", | |||||
| ); | |||||
| $caught = null; | |||||
| try { | |||||
| $value = phutil_json_encode($in); | |||||
| } catch (Exception $ex) { | |||||
| $caught = $ex; | |||||
| } | |||||
| $this->assertTrue(($caught instanceof Exception)); | |||||
| } | |||||
| } | } | ||||