Changeset 49538 for trunk/tests/phpunit/tests/multisite/networkQuery.php
- Timestamp:
- 11/08/2020 11:45:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/multisite/networkQuery.php
r48987 r49538 555 555 return array( 555 ); 556 556 } 557 558 /** 559 * @ticket 51333 560 */ 561 public function test_networks_pre_query_filter_should_set_networks_property() { 562 add_filter( 'networks_pre_query', array( __CLASS__, 'filter_networks_pre_query_and_set_networks' ), 10, 2 ); 563 564 $q = new WP_Network_Query(); 565 $results = $q->query( array() ); 566 567 remove_filter( 'networks_pre_query', array( __CLASS__, 'filter_networks_pre_query_and_set_networks' ), 10 ); 568 569 // Make sure the networks property is the same as the results. 570 $this->assertSame( $results, $q->networks ); 571 572 // Make sure the network domain is `wordpress.org`. 573 $this->assertSame( 'wordpress.org', $q->networks[0]->domain ); 574 } 575 576 public static function filter_networks_pre_query_and_set_networks( $networks, $query ) { 577 return array( get_network( self::$network_ids['wordpress.org/'] ) ); 578 } 557 579 } 558 580
Note: See TracChangeset
for help on using the changeset viewer.