tests/phpunit/includes/StringUtilsTest.php:42:3
- avoid function calls in a FOR loop test part
tests/phpunit/includes/PathRouterTest.php:155 to 165
- fix space/tabs indenting
- convert double quotes to single for consistency
tests/phpunit/data/xmp/7.result.php
- reindent to use tabs instead of spaces
- removed trailing whitespaces
tests/phpunit/includes/filebackend/FileBackendTest.php
- spaces in indentation
Change-Id: I9c15803f961fc88b798ada3dd6c2b292c1de2143
Language class had a code snippet to verify whether a text is valid
UTF-8 though that could not be used from another place. The snippet use
mb_check_encoding() and fallback to some regex whenever mbstring is not
available.
* introduce StringUtils::isUtf8() which is mostly code moved out of the
language class.
* Enhance regex readability by using an expanded regex (//x)
* Made the regex to recognize longer sequences
* Add some unit tests to the mbstring and the PHP native implementation
* An optional second parameter can be passed to isUtf8() to force the
use of our PHP implementation. This is used for unit testing.
Change-Id: I4cf4dfe2eb02f046db1726f4654ba649e01419f2