Changeset 51397 for trunk/tests/phpunit/tests/adminbar.php
- Timestamp:
- 07/10/2021 11:15:44 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/adminbar.php
r51331 r51397 703 703 $nodes = $wp_admin_bar->get_nodes(); 704 704 foreach ( $this->get_my_sites_network_menu_items() as $id => $cap ) { 705 $this->assert False( isset( $nodes[ $id ] ), sprintf( 'Menu item %s must not display for a regular user.', $id ) );705 $this->assertArrayNotHasKey( $id, $nodes, sprintf( 'Menu item %s must not display for a regular user.', $id ) ); 706 706 } 707 707 } … … 720 720 $nodes = $wp_admin_bar->get_nodes(); 721 721 foreach ( $this->get_my_sites_network_menu_items() as $id => $cap ) { 722 $this->assert True( isset( $nodes[ $id ] ), sprintf( 'Menu item %s must display for a super admin.', $id ) );722 $this->assertArrayHasKey( $id, $nodes, sprintf( 'Menu item %s must display for a super admin.', $id ) ); 723 723 } 724 724 } … … 746 746 foreach ( $this->get_my_sites_network_menu_items() as $id => $cap ) { 747 747 if ( in_array( $cap, $network_user_caps, true ) ) { 748 $this->assert True( isset( $nodes[ $id ] ), sprintf( 'Menu item %1$s must display for a user with the %2$s cap.', $id, $cap ) );748 $this->assertArrayHasKey( $id, $nodes, sprintf( 'Menu item %1$s must display for a user with the %2$s cap.', $id, $cap ) ); 749 749 } else { 750 $this->assert False( isset( $nodes[ $id ] ), sprintf( 'Menu item %1$s must not display for a user without the %2$s cap.', $id, $cap ) );750 $this->assertArrayNotHasKey( $id, $nodes, sprintf( 'Menu item %1$s must not display for a user without the %2$s cap.', $id, $cap ) ); 751 751 } 752 752 }
Note: See TracChangeset
for help on using the changeset viewer.