Make WordPress Core

Changeset 46648


Ignore:
Timestamp:
11/04/2019 12:34:35 PM (5 years ago)
Author:
SergeyBiryukov
Message:

REST API: Set orderby parameter in tax relation unit tests added in [46646].

The default value of date caused a race condition resulting in random test failures.

See #44326.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php

    r46646 r46648  
    979979        $request->set_param( 'tags', array( $tag['term_id'] ) );
    980980        $request->set_param( 'categories', array( $category['term_id'] ) );
     981        $request->set_param( 'orderby', 'id' );
    981982
    982983        $response = rest_get_server()->dispatch( $request );
     
    10331034        $request->set_param( 'categories_exclude', array( $category['term_id'] ) );
    10341035        $request->set_param( 'tax_relation', 'OR' );
     1036        $request->set_param( 'orderby', 'id' );
    10351037
    10361038        $response = rest_get_server()->dispatch( $request );
    10371039        $data     = $response->get_data();
    10381040        $this->assertCount( 3, $data );
    1039         $this->assertEquals( $id2, $data[0]['id'] );
    1040         $this->assertEquals( $id4, $data[1]['id'] );
     1041        $this->assertEquals( $id4, $data[0]['id'] );
     1042        $this->assertEquals( $id2, $data[1]['id'] );
    10411043        $this->assertEquals( $id1, $data[2]['id'] );
    10421044    }
Note: See TracChangeset for help on using the changeset viewer.