Add basic unit tests for is_plugin_active() and is_plugin_inactive().

Props voldemortensen.
Fixes #30489.

git-svn-id: https://develop.svn.wordpress.org/trunk@30557 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges 2014-11-25 01:12:39 +00:00
parent bc53a39130
commit 4537217cf1

View File

@ -56,4 +56,28 @@ class Tests_Admin_includesPlugin extends WP_UnitTestCase {
wp_set_current_user( $current_user );
}
function test_is_plugin_active_true() {
activate_plugin( 'hello.php' );
$test = is_plugin_active( 'hello.php' );
$this->assertTrue( $test );
}
function test_is_plugin_active_false() {
deactivate_plugins( 'hello.php' );
$test = is_plugin_active( 'hello.php' );
$this->assertFalse( $test );
}
function test_is_plugin_inactive_true() {
deactivate_plugins( 'hello.php' );
$test = is_plugin_inactive( 'hello.php' );
$this->assertTrue( $test );
}
function test_is_plugin_inactive_false() {
activate_plugin( 'hello.php' );
$test = is_plugin_inactive( 'hello.php' );
$this->assertFalse( $test );
}
}