From f46c0a637b3090b405b095ca330aac06c86a21db Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 29 Dec 2015 04:39:02 +0000 Subject: [PATCH] Tests: When testing the `utf8mb4` charset, ensure that the current MySQL server has `utf8mb4` support. See #35249. git-svn-id: https://develop.svn.wordpress.org/trunk@36116 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/db/charset.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/phpunit/tests/db/charset.php b/tests/phpunit/tests/db/charset.php index cfd025e003..584a62886e 100644 --- a/tests/phpunit/tests/db/charset.php +++ b/tests/phpunit/tests/db/charset.php @@ -359,6 +359,10 @@ class Tests_DB_Charset extends WP_UnitTestCase { $new_charset = $data[0]['charset']; } + if ( 'utf8mb4' === $new_charset && ! self::$_wpdb->has_cap( 'utf8mb4' ) ) { + $this->markTestSkipped( "The current MySQL server doesn't support the utf8mb4 character set." ); + } + self::$_wpdb->charset = $new_charset; self::$_wpdb->set_charset( self::$_wpdb->dbh, $new_charset );