Make WordPress Core

Changeset 34550


Ignore:
Timestamp:
09/25/2015 03:28:56 PM (9 years ago)
Author:
boonebgorges
Message:

Hierarchical comment query tests should be order-agnostic.

Travis-CI and other test environments can create weird race conditions.

See #8071.

File:
1 edited

Legend:

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

    r34546 r34550  
    20322032
    20332033        // Top-level comments.
    2034         $this->assertEquals( array( $c1, $c5 ), array_values( wp_list_pluck( $q->comments, 'comment_ID' ) ) );
     2034        $this->assertEqualSets( array( $c1, $c5 ), array_values( wp_list_pluck( $q->comments, 'comment_ID' ) ) );
    20352035
    20362036        // Direct descendants of $c1.
    2037         $this->assertEquals( array( $c2, $c4 ), array_values( wp_list_pluck( $q->comments[ $c1 ]->get_children(), 'comment_ID' ) ) );
     2037        $this->assertEqualSets( array( $c2, $c4 ), array_values( wp_list_pluck( $q->comments[ $c1 ]->get_children(), 'comment_ID' ) ) );
    20382038
    20392039        // Direct descendants of $c2.
    2040         $this->assertEquals( array( $c3 ), array_values( wp_list_pluck( $q->comments[ $c1 ]->get_child( $c2 )->get_children(), 'comment_ID' ) ) );
     2040        $this->assertEqualSets( array( $c3 ), array_values( wp_list_pluck( $q->comments[ $c1 ]->get_child( $c2 )->get_children(), 'comment_ID' ) ) );
    20412041
    20422042        // Direct descendants of $c5.
    2043         $this->assertEquals( array( $c6 ), array_values( wp_list_pluck( $q->comments[ $c5 ]->get_children(), 'comment_ID' ) ) );
     2043        $this->assertEqualSets( array( $c6 ), array_values( wp_list_pluck( $q->comments[ $c5 ]->get_children(), 'comment_ID' ) ) );
    20442044    }
    20452045}
Note: See TracChangeset for help on using the changeset viewer.