Add basic unit tests for `is_plugin_active_for_network()`

Props rodrigosprimo
Fixes #30491


git-svn-id: https://develop.svn.wordpress.org/trunk@30559 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt 2014-11-25 04:02:26 +00:00
parent c2c0eee75a
commit f1e5edee9a
1 changed files with 10 additions and 0 deletions

View File

@ -133,6 +133,16 @@ class Tests_Multisite_Network extends WP_UnitTestCase {
remove_action( 'activate_' . $path, array ( $mock, 'action' ) );
}
function test_is_plugin_active_for_network_true() {
activate_plugin( 'hello.php', '', true );
$this->assertTrue( is_plugin_active_for_network( 'hello.php' ) );
}
function test_is_plugin_active_for_network_false() {
deactivate_plugins( 'hello.php', false, true );
$this->assertFalse( is_plugin_active_for_network( 'hello.php' ) );
}
function _helper_deactivate_hook() {
$this->plugin_hook_count++;
}