WordPress.org

Make WordPress Core

Ticket #33171: 33171.patch

File 33171.patch, 1.3 KB (added by ocean90, 3 years ago)
  • tests/phpunit/tests/db/charset.php

     
    1414         */
    1515        protected static $_wpdb;
    1616
     17        /**
     18         * The version of the MySQL server.
     19         * @var string
     20         */
     21        private static $server_info;
     22
    1723        public static function setUpBeforeClass() {
    1824                require_once( dirname( dirname( __FILE__ ) ) . '/db.php' );
    1925
    2026                self::$_wpdb = new wpdb_exposed_methods_for_testing();
     27
     28                if ( self::$_wpdb->use_mysqli ) {
     29                        self::$server_info = mysqli_get_server_info( self::$_wpdb->dbh );
     30                } else {
     31                        self::$server_info = mysql_get_server_info( self::$_wpdb->dbh );
     32                }
    2133        }
    2234
    2335        /**
     
    362374                if ( 'utf8mb4' === $new_charset && ! self::$_wpdb->has_cap( 'utf8mb4' ) ) {
    363375                        $this->markTestSkipped( "The current MySQL server doesn't support the utf8mb4 character set." );
    364376                }
     377               
     378                if ( 'big5' === $new_charset && 'byte' === $data[0]['length']['type'] && false !== strpos( self::$server_info, 'MariaDB' ) ) {
     379                        $this->markTestSkipped( "MariaDB doesn't support this data set, see https://core.trac.wordpress.org/ticket/33171." );
     380                }
    365381
    366382                self::$_wpdb->charset = $new_charset;
    367383                self::$_wpdb->set_charset( self::$_wpdb->dbh, $new_charset );