* This test StringUtils::isUtf8 whenever we have mbstring extension
* loaded.
*
- * @cover StringUtils::isUtf8
+ * @covers StringUtils::isUtf8
* @dataProvider provideStringsForIsUtf8Check
*/
function testIsUtf8WithMbstring( $expected, $string ) {
* implementation used as a fallback when mb_check_encoding() is
* not available.
*
- * @cover StringUtils::isUtf8
+ * @covers StringUtils::isUtf8
* @dataProvider provideStringsForIsUtf8Check
*/
function testIsUtf8WithPhpFallbackImplementation( $expected, $string ) {
$this->assertEquals( $expected,
- StringUtils::isUtf8( $string, /** disable mbstring: */ true ),
+ StringUtils::isUtf8( $string, /** disable mbstring: */true ),
'Testing string "' . $this->escaped( $string ) . '" with pure PHP implementation'
);
}
$escaped .= $char;
}
}
+
return $escaped;
}
* Markus Kuhn:
* http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
*/
- function provideStringsForIsUtf8Check() {
+ public static function provideStringsForIsUtf8Check() {
// Expected return values for StringUtils::isUtf8()
$PASS = true;
$FAIL = false;
array( $FAIL, "\xff" ),
array( $FAIL, "\xfe\xfe\xff\xff" ),
- /**
+ /*
# The PHP implementation does not handle characters
# being represented in a form which is too long :(
array( $FAIL, "\xf0\x8F\xbf\xbf" ),
array( $FAIL, "\xf8\x87\xbf\xbf" ),
array( $FAIL, "\xfc\x83\xbf\xbf\xbf\xbf" ),
- **/
+ */
# non characters
array( $PASS, "\xef\xbf\xbe" ),