Changeset 55580 for trunk/tests/phpunit/tests/adminbar.php
- Timestamp:
- 03/21/2023 07:58:45 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/adminbar.php
r54891 r55580 755 755 ); 756 756 } 757 758 /** 759 * This test ensures that WP_Admin_Bar::$proto is not defined (including magic methods). 760 * 761 * @ticket 56876 762 * @coversNothing 763 */ 764 public function test_proto_property_is_not_defined() { 765 $admin_bar = new WP_Admin_Bar(); 766 $this->assertFalse( property_exists( $admin_bar, 'proto' ), 'WP_Admin_Bar::$proto should not be defined.' ); 767 $this->assertFalse( isset( $admin_bar->proto ), 'WP_Admin_Bar::$proto should not be defined.' ); 768 } 769 770 /** 771 * This test ensures that WP_Admin_Bar::$menu is declared as a "regular" class property. 772 * 773 * @ticket 56876 774 * @coversNothing 775 */ 776 public function test_menu_property_is_defined() { 777 $admin_bar = new WP_Admin_Bar(); 778 $this->assertTrue( property_exists( $admin_bar, 'menu' ), 'WP_Admin_Bar::$proto property should be defined.' ); 779 780 $menu_property = new ReflectionProperty( WP_Admin_Bar::class, 'menu' ); 781 $this->assertTrue( $menu_property->isPublic(), 'WP_Admin_Bar::$menu should be public.' ); 782 783 $this->assertTrue( isset( $admin_bar->menu ), 'WP_Admin_Bar::$menu should be set.' ); 784 $this->assertSame( array(), $admin_bar->menu, 'WP_Admin_Bar::$menu should be equal to an empty array.' ); 785 } 757 786 }
Note: See TracChangeset
for help on using the changeset viewer.