mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Multisite: Correct default value for orderby in WP_Network_Query::__construct().
Add a unit test. See #32504. git-svn-id: https://develop.svn.wordpress.org/trunk@38102 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -59,6 +59,27 @@ class Tests_Multisite_Network_Query extends WP_UnitTestCase {
|
||||
$this->assertEquals( 3, count( $found ) );
|
||||
}
|
||||
|
||||
public function test_wp_network_query_by_network__in_with_order() {
|
||||
$expected = array( self::$network_ids['wordpress.org/'], self::$network_ids['make.wordpress.org/'] );
|
||||
|
||||
$q = new WP_Network_Query();
|
||||
$found = $q->query( array(
|
||||
'fields' => 'ids',
|
||||
'network__in' => $expected,
|
||||
'order' => 'ASC',
|
||||
) );
|
||||
|
||||
$this->assertEquals( $expected, $found );
|
||||
|
||||
$found = $q->query( array(
|
||||
'fields' => 'ids',
|
||||
'network__in' => $expected,
|
||||
'order' => 'DESC',
|
||||
) );
|
||||
|
||||
$this->assertEquals( array_reverse( $expected ), $found );
|
||||
}
|
||||
|
||||
public function test_wp_network_query_by_network__in_with_single_id() {
|
||||
$expected = array( self::$network_ids['wordpress.org/'] );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user