markTestSkipped( MULTISITE_SKIP_MSG ); } $multisite = new Multisite(); $this->assertInstanceOf( MULTISITE_CLASS, $multisite ); } /** * Test is_multisite_compatible method. * * @return void */ public function test_is_multisite_compatible() { if ( ! class_exists( MULTISITE_CLASS ) ) { $this->markTestSkipped( MULTISITE_SKIP_MSG ); } $multisite = new Multisite(); $this->assertTrue( $multisite->is_multisite_compatible() ); } /** * Test get_network_sites method. * * @return void */ public function test_get_network_sites() { if ( ! class_exists( MULTISITE_CLASS ) ) { $this->markTestSkipped( MULTISITE_SKIP_MSG ); } $multisite = new Multisite(); // Mock the get_sites function if we're not in a multisite environment. if ( ! function_exists( 'get_sites' ) ) { $this->assertEquals( array(), $multisite->get_network_sites() ); } else { $sites = $multisite->get_network_sites(); $this->assertIsArray( $sites ); } } /** * Test initialize_hooks method. * * @return void */ public function test_initialize_hooks() { if ( ! class_exists( MULTISITE_CLASS ) ) { $this->markTestSkipped( MULTISITE_SKIP_MSG ); } $multisite = new Multisite(); // Call the method. $multisite->initialize_hooks(); // Check if the action was added. $this->assertEquals( 10, has_action( 'network_admin_menu', array( $multisite, 'add_network_menu' ) ) ); } }