mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
WPDB: Some character set tests were failing if DB_CHARSET was empty, or a non-utf8 character set.
git-svn-id: https://develop.svn.wordpress.org/trunk@31372 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -729,12 +729,23 @@ class Tests_DB extends WP_UnitTestCase {
|
||||
*/
|
||||
function test_process_fields() {
|
||||
global $wpdb;
|
||||
|
||||
if ( $wpdb->charset ) {
|
||||
$expected_charset = $wpdb->charset;
|
||||
} else {
|
||||
$expected_charset = $wpdb->get_col_charset( $wpdb->posts, 'post_content' );
|
||||
}
|
||||
|
||||
if ( ! in_array( $expected_charset, array( 'utf8', 'utf8mb4', 'latin1' ) ) ) {
|
||||
$this->markTestSkipped( "This test only works with utf8, utf8mb4 or latin1 character sets" );
|
||||
}
|
||||
|
||||
$data = array( 'post_content' => '¡foo foo foo!' );
|
||||
$expected = array(
|
||||
'post_content' => array(
|
||||
'value' => '¡foo foo foo!',
|
||||
'format' => '%s',
|
||||
'charset' => $wpdb->charset,
|
||||
'charset' => $expected_charset,
|
||||
'ascii' => false,
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user