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:
parent
7e349ec5c4
commit
951409119e
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue