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
This commit is contained in:
Boone Gorges 2014-11-24 14:55:49 +00:00
parent 7e349ec5c4
commit 951409119e
1 changed files with 10 additions and 2 deletions

View File

@ -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 );