From f1e5edee9a151a8e8ce45b7431aec0cb0cfc3d27 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Tue, 25 Nov 2014 04:02:26 +0000 Subject: [PATCH] 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 --- tests/phpunit/tests/multisite/network.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/phpunit/tests/multisite/network.php b/tests/phpunit/tests/multisite/network.php index 5b424ca8d4..058f411282 100644 --- a/tests/phpunit/tests/multisite/network.php +++ b/tests/phpunit/tests/multisite/network.php @@ -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++; }