WPDB Unit Tests: Fix a fatal error that occurs in the test_strip_invalid_text()
test if the mbstring
extension isn't activated in PHP.
git-svn-id: https://develop.svn.wordpress.org/trunk@30631 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9d74e43a4b
commit
ea89b1c942
@ -76,6 +76,7 @@ class Tests_DB_Charset extends WP_UnitTestCase {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( function_exists( 'mb_convert_encoding' ) ) {
|
||||||
// big5 is a non-Unicode multibyte charset
|
// big5 is a non-Unicode multibyte charset
|
||||||
$utf8 = "a\xe5\x85\xb1b"; // UTF-8 Character 20849
|
$utf8 = "a\xe5\x85\xb1b"; // UTF-8 Character 20849
|
||||||
$big5 = mb_convert_encoding( $utf8, 'BIG-5', 'UTF-8' );
|
$big5 = mb_convert_encoding( $utf8, 'BIG-5', 'UTF-8' );
|
||||||
@ -89,6 +90,7 @@ class Tests_DB_Charset extends WP_UnitTestCase {
|
|||||||
'value' => $big5,
|
'value' => $big5,
|
||||||
'expected' => $big5
|
'expected' => $big5
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// The data above is easy to edit. Now, prepare it for the data provider.
|
// The data above is easy to edit. Now, prepare it for the data provider.
|
||||||
$data_provider = $multiple = $multiple_expected = array();
|
$data_provider = $multiple = $multiple_expected = array();
|
||||||
|
Loading…
Reference in New Issue
Block a user