diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index 3e06afcc1bf2c..fc2413751ff47 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -296,7 +296,7 @@ public function test_set_sql_mode() { $check_new_modes = $wpdb->get_var( 'SELECT @@SESSION.sql_mode;' ); $this->assertSameSets( $new_modes, explode( ',', $check_new_modes ) ); - $wpdb->set_sql_mode( explode( ',', $current_modes ) ); + $wpdb->set_sql_mode( empty( $current_modes ) ? '' : explode( ',', $current_modes ) ); } /**