Make WordPress Core


Ignore:
Timestamp:
07/19/2016 01:09:39 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Multisite: Correct default value for orderby in WP_Network_Query::__construct().

Add a unit test.

See #32504.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/networkQuery.php

    r37894 r38102  
    6060    }
    6161
     62    public function test_wp_network_query_by_network__in_with_order() {
     63        $expected = array( self::$network_ids['wordpress.org/'], self::$network_ids['make.wordpress.org/'] );
     64
     65        $q = new WP_Network_Query();
     66        $found = $q->query( array(
     67            'fields'      => 'ids',
     68            'network__in' => $expected,
     69            'order'       => 'ASC',
     70        ) );
     71
     72        $this->assertEquals( $expected, $found );
     73
     74        $found = $q->query( array(
     75            'fields'      => 'ids',
     76            'network__in' => $expected,
     77            'order'       => 'DESC',
     78        ) );
     79
     80        $this->assertEquals( array_reverse( $expected ), $found );
     81    }
     82
    6283    public function test_wp_network_query_by_network__in_with_single_id() {
    6384        $expected = array( self::$network_ids['wordpress.org/'] );
Note: See TracChangeset for help on using the changeset viewer.