Skip to content

Commit

Permalink
fix tests hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
davidperezgar committed Oct 2, 2024
1 parent 21a8df1 commit 8fbf670
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/phpunit/tests/Admin/Admin_Page_Tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ public function set_up() {

public function test_add_hooks() {
$this->admin_page->add_hooks();
$this->assertEquals( 10, has_action( 'admin_menu', array( $this->admin_page, 'add_and_initialize_page' ) ) );
$this->assertEquals( 10, has_filter( 'plugin_action_links', array( $this->admin_page, 'filter_plugin_action_links' ) ) );
$admin_menu_hook = is_multisite() ? 'network_admin_menu' : 'admin_menu';
$plugin_action_link_hook = is_multisite() ? 'network_admin_plugin_action_links' : 'plugin_action_links';

$this->assertEquals( 10, has_action( $admin_menu_hook, array( $this->admin_page, 'add_and_initialize_page' ) ) );
$this->assertEquals( 10, has_filter( $plugin_action_link_hook, array( $this->admin_page, 'filter_plugin_action_links' ) ) );
}

public function test_add_and_initialize_page() {
Expand Down

0 comments on commit 8fbf670

Please sign in to comment.