From 951409119ec21c562a8632c95dda3bdfeb480c5e Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 24 Nov 2014 14:55:49 +0000 Subject: [PATCH] Declare an explicit 'order' in `test_get_comments_by_user()`. This change fixes broken builds on older versions of MySQL. See #30462. Assertions regarding indeterminate secondary ORDER BY clauses will go in separate test methods. See #30478. git-svn-id: https://develop.svn.wordpress.org/trunk@30548 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/comment/query.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/phpunit/tests/comment/query.php b/tests/phpunit/tests/comment/query.php index dbdcf6aa58..3f56ee2812 100644 --- a/tests/phpunit/tests/comment/query.php +++ b/tests/phpunit/tests/comment/query.php @@ -639,13 +639,21 @@ class Tests_Comment_Query extends WP_UnitTestCase { $this->factory->comment->create( array( 'user_id' => $users[0], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); $this->factory->comment->create( array( 'user_id' => $users[1], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) ); - $comments = get_comments( array( 'user_id' => $users[0] ) ); + $comments = get_comments( array( + 'user_id' => $users[0], + 'orderby' => 'comment_ID', + 'order' => 'ASC', + ) ); $this->assertCount( 2, $comments ); $this->assertEquals( $users[0], $comments[0]->user_id ); $this->assertEquals( $users[0], $comments[1]->user_id ); - $comments = get_comments( array( 'user_id' => $users ) ); + $comments = get_comments( array( + 'user_id' => $users, + 'orderby' => 'comment_ID', + 'order' => 'ASC', + ) ); $this->assertCount( 3, $comments ); $this->assertEquals( $users[0], $comments[0]->user_id );