Skip to content

Commit

Permalink
Update failing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
coreymckrill committed May 17, 2024
1 parent 54a9f17 commit 7932e42
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,18 @@ public function test_get_plugin_path_from_slug() {
* Test get_active_plugin_slugs()
*/
public function test_get_active_plugin_slugs() {

// Get active slugs.
$active_slugs = PluginsHelper::get_active_plugin_slugs();

// Phpunit test environment active plugins option is empty.
$this->assertEquals( array(), $active_slugs, 'Should not be any active slugs.' );
$this->assertEquals( array( 'woocommerce' ), $active_slugs, 'WooCommerce should be the only active slug.' );

// Get facebook plugin path.
// Activate Akismet.
$akismet_path = PluginsHelper::get_plugin_path_from_slug( 'akismet' );

// Activate facebook plugin.
activate_plugin( $akismet_path );

// Get active slugs.
$active_slugs = PluginsHelper::get_active_plugin_slugs();
$expected_slugs = array( 'akismet', 'woocommerce' );
$actual_slugs = PluginsHelper::get_active_plugin_slugs();

// Phpunit test environment active plugins option is empty.
$this->assertEquals( array( 'akismet' ), $active_slugs, 'Akismet should be listed as active.' );
$this->assertEquals( $expected_slugs, $actual_slugs, 'Akismet should be listed as active.' );
}

/**
Expand Down

0 comments on commit 7932e42

Please sign in to comment.