Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2618932
D25326.1731623457.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
667 B
Referenced Files
None
Subscribers
None
D25326.1731623457.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D25326: Add explicit tests for phutil_string_cast
Attached
Detach File
Event Timeline
Log In to Comment