Make WordPress Core

Changeset 30548


Ignore:
Timestamp:
11/24/2014 02:55:49 PM (12 years ago)
Author:
boonebgorges
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/query.php

    r30402 r30548  
    640640                $this->factory->comment->create( array( 'user_id' => $users[1], 'comment_post_ID' => $this->post_id, 'comment_approved' => '1' ) );
    641641
    642                 $comments = get_comments( array( 'user_id' => $users[0] ) );
     642                $comments = get_comments( array(
     643                        'user_id' => $users[0],
     644                        'orderby' => 'comment_ID',
     645                        'order' => 'ASC',
     646                ) );
    643647
    644648                $this->assertCount( 2, $comments );
     
    646650                $this->assertEquals( $users[0], $comments[1]->user_id );
    647651
    648                 $comments = get_comments( array( 'user_id' => $users ) );
     652                $comments = get_comments( array(
     653                        'user_id' => $users,
     654                        'orderby' => 'comment_ID',
     655                        'order' => 'ASC',
     656                ) );
    649657
    650658                $this->assertCount( 3, $comments );
Note: See TracChangeset for help on using the changeset viewer.