Page MenuHomePhorge

D25326.1731623457.diff
No OneTemporary

D25326.1731623457.diff

diff --git a/src/utils/__tests__/PhutilUtilsTestCase.php b/src/utils/__tests__/PhutilUtilsTestCase.php
--- a/src/utils/__tests__/PhutilUtilsTestCase.php
+++ b/src/utils/__tests__/PhutilUtilsTestCase.php
@@ -1070,4 +1070,20 @@
}
}
+
+ public function testStringCasting() {
+ $map = array(
+ array(123, '123', 'number'),
+ array(null, '', 'null to empty string'),
+ array('text', 'text', 'string'),
+ );
+
+ foreach ($map as $test_case) {
+ list($input, $expected_output, $test_name) = $test_case;
+
+ $actual = phutil_string_cast($input);
+
+ $this->assertEqual($expected_output, $actual, $test_name);
+ }
+ }
}

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 14, 22:30 (5 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
970697
Default Alt Text
D25326.1731623457.diff (667 B)

Event Timeline