From 95282946132ecd166600864f39c451355e102b47 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 2 Dec 2014 05:11:49 +0000 Subject: [PATCH] Unit Tests: The `test_set_allowed_incompatible_sql_mode()` test tries to set the `NO_ZERO_DATE` sql mode, which was removed in MySQL 5.7. This causes the test to incorrectly fail when run against MySQL 5.7. git-svn-id: https://develop.svn.wordpress.org/trunk@30704 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/db.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php index f0f89637fd..c06a0e5631 100644 --- a/tests/phpunit/tests/db.php +++ b/tests/phpunit/tests/db.php @@ -317,20 +317,20 @@ class Tests_DB extends WP_UnitTestCase { $current_modes = $wpdb->get_var( 'SELECT @@SESSION.sql_mode;' ); - $new_modes = array( 'IGNORE_SPACE', 'NO_ZERO_DATE', 'NO_AUTO_CREATE_USER' ); + $new_modes = array( 'IGNORE_SPACE', 'ONLY_FULL_GROUP_BY', 'NO_AUTO_CREATE_USER' ); add_filter( 'incompatible_sql_modes', array( $this, 'filter_allowed_incompatible_sql_mode' ), 1, 1 ); $wpdb->set_sql_mode( $new_modes ); remove_filter( 'incompatible_sql_modes', array( $this, 'filter_allowed_incompatible_sql_mode' ), 1 ); $check_new_modes = $wpdb->get_var( 'SELECT @@SESSION.sql_mode;' ); - $this->assertContains( 'NO_ZERO_DATE', explode( ',', $check_new_modes ) ); + $this->assertContains( 'ONLY_FULL_GROUP_BY', explode( ',', $check_new_modes ) ); $wpdb->set_sql_mode( explode( ',', $current_modes ) ); } public function filter_allowed_incompatible_sql_mode( $modes ) { - $pos = array_search( 'NO_ZERO_DATE', $modes ); + $pos = array_search( 'ONLY_FULL_GROUP_BY', $modes ); $this->assertGreaterThanOrEqual( 0, $pos ); if ( FALSE === $pos ) {