66use WP_Site ;
77
88class Orchestrate_Sites_Tests extends \WP_UnitTestCase {
9- function setUp (): void {
9+ public function setUp (): void {
1010 if ( ! is_multisite () ) {
1111 $ this ->markTestSkipped ( 'Skipping tests that only run on multisites. ' );
1212 }
1313
1414 parent ::setUp ();
1515 }
1616
17- function tearDown (): void {
18- parent ::tearDown ();
19- }
20-
21- function test_list_sites_removes_inactive_subsites () {
17+ public function test_list_sites_removes_inactive_subsites () {
2218 add_filter ( 'sites_pre_query ' , [ $ this , 'mock_get_sites ' ], 10 , 2 );
2319
2420 // The archived/spam/deleted subsites should not be returned.
@@ -29,7 +25,7 @@ function test_list_sites_removes_inactive_subsites() {
2925 remove_filter ( 'sites_pre_query ' , [ $ this , 'mock_get_sites ' ], 10 , 2 );
3026 }
3127
32- function test_list_sites_2_hosts () {
28+ public function test_list_sites_2_hosts () {
3329 add_filter ( 'sites_pre_query ' , [ $ this , 'mock_get_sites ' ], 10 , 2 );
3430
3531 // With two hosts, all active sites should still be returned.
@@ -41,7 +37,7 @@ function test_list_sites_2_hosts() {
4137 remove_filter ( 'sites_pre_query ' , [ $ this , 'mock_get_sites ' ], 10 , 2 );
4238 }
4339
44- function test_list_sites_7_hosts () {
40+ public function test_list_sites_7_hosts () {
4541 add_filter ( 'sites_pre_query ' , [ $ this , 'mock_get_sites ' ], 10 , 2 );
4642
4743 // With seven hosts, our current request should only be given two of the active sites.
@@ -53,7 +49,7 @@ function test_list_sites_7_hosts() {
5349 remove_filter ( 'sites_pre_query ' , [ $ this , 'mock_get_sites ' ], 10 , 2 );
5450 }
5551
56- function mock_hosts_list ( $ number_of_hosts ) {
52+ public function mock_hosts_list ( $ number_of_hosts ) {
5753 // Always have the "current" host.
5854 $ heartbeats = [ gethostname () => time () ];
5955
@@ -66,7 +62,7 @@ function mock_hosts_list( $number_of_hosts ) {
6662 wp_cache_set ( CLI \Orchestrate_Sites::RUNNER_HOST_HEARTBEAT_KEY , $ heartbeats );
6763 }
6864
69- function mock_get_sites ( $ site_data , $ query_class ) {
65+ public function mock_get_sites ( $ site_data , $ query_class ) {
7066 if ( $ query_class ->query_vars ['count ' ] ) {
7167 return 7 ;
7268 }
0 commit comments