Conversation
…bstring extension gives a wrong result
); | ||
} | ||
|
||
|
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.
Redundant blank line.
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.
removed
hopefully done now |
|
||
// Full Unicode, in terms of uint16_t or uint32_t (with machine dependent endianness and alignment) | ||
// 'UCS-2-INTERNAL', | ||
// 'UCS-4-INTERNAL', |
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.
It should either be noted why those are commented out or those lines should be removed completely.
|
||
public function wordWrapProvider() | ||
{ | ||
return array( |
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.
For some reason, my comment wasn't saved here yesterday:
Use string keys for all data sets (e.g. the original test names, lowercase-dashed). Those will be used for reporting failures, instead of the numeric index, which helps a lot to also understand what the data set is actually testing.
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.
Now I understand what you mean - I already added the orig. test method names but not as array keys -> updated
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.
Since this is already the word wrap data provider, I'd personally remove the redundant leading "word-wrap-" from the data set names :)
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.
removed
@marc-mabe I think with the addition of the Many thanks in advance -- this looks like it will be quite useful! |
@weierophinney: I removed the |
I get 2 failures when I run tests; details are below. These are with PHP 5.4.9, using iconv v2.15 and libmbfl v1.3.2.
Travis doesn't report errors, so I'm going to go ahead and merge, but wanted to note the potential conflicts in versions. |
I added the Possibilities:
I personally prefer to simply remove the test, leave the |
@marc-mabe Makes sense -- give me a new PR, and I'll merge. |
noted in zendframework/zendframework#3110 (which added the test)
This class provides some basic handling of strings of different character encodings.
It comes with string wrappers for
iconv
,mbstring
,intl
(grapheme_*
functions / UConverter) and a wrapper for native string functions. Wrapped functions are:strlen
,strpos
,substr
,strpad
,wordwrap
,convert
.So it will be up to the user which PHP extension will be used supporting the required character encoding and which one is the best for a given character encoding.
Wrapper usage:
The following command returns an instance of the best available string wrapper supporting the given character encoding and if given with support to convert a string of the encoding into the other encoding.
If no wrapper was found an exception will be thrown.
The returned
StringWrapperInterface
simply wrappes the string functions -- there will be no error handling because of the heavy use of string functions (like in a loop) this should be up the consumer.More helpful methods:
PS:
intl
,mbstring
,iconv
,native
Zend\Text\MultiByte
will be deprecated and redirected using the string wrapper(all tests has been moved)