-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make StringFormatter trim value #3
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,17 +26,20 @@ class StringFormatterTest extends ValueFormatterTestBase { | |
*/ | ||
public function validProvider() { | ||
$strings = array( | ||
'ice cream', | ||
'cake', | ||
'', | ||
' a ', | ||
' ', | ||
'ice cream' => 'ice cream', | ||
'cake' => 'cake', | ||
'' => '', | ||
' a ' => 'a', | ||
' a' => 'a', | ||
'a ' => 'a', | ||
' ' => '', | ||
' ' => '', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The old JavaScript code was trimming a lot more space characters. Please add some more tests: We do have a StringNormalizer that does that. I'm not sure if it should used here or if it's more sane to stick with the simple trim(). |
||
); | ||
|
||
$argLists = array(); | ||
|
||
foreach ( $strings as $string ) { | ||
$argLists[] = array( new StringValue( $string ), $string ); | ||
foreach ( $strings as $value => $expected ) { | ||
$argLists[] = array( new StringValue( $value ), $expected ); | ||
} | ||
|
||
return $argLists; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Edit: Can't be null, no check needed.