Changeset 56348
- Timestamp:
- 08/02/2023 05:58:18 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/wpListTable.php
r54215 r56348 13 13 * @var WP_List_Table $list_table 14 14 */ 15 protected static $list_table; 15 private $list_table; 16 17 /** 18 * Original value of $GLOBALS['hook_suffix']. 19 * 20 * @var string 21 */ 22 private static $original_hook_suffix; 16 23 17 24 public static function set_up_before_class() { 25 parent::set_up_before_class(); 26 27 static::$original_hook_suffix = $GLOBALS['hook_suffix']; 28 29 require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; 30 } 31 32 public function set_up() { 33 parent::set_up(); 18 34 global $hook_suffix; 19 20 parent::set_up_before_class();21 22 require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';23 24 35 $hook_suffix = '_wp_tests'; 25 self::$list_table = new WP_List_Table(); 36 $this->list_table = new WP_List_Table(); 37 } 38 39 public function clean_up_global_scope() { 40 global $hook_suffix; 41 $hook_suffix = static::$original_hook_suffix; 42 parent::clean_up_global_scope(); 26 43 } 27 44 … … 143 160 */ 144 161 public function test_get_views_links( $link_data, $expected ) { 145 $get_views_links = new ReflectionMethod( self::$list_table, 'get_views_links' );162 $get_views_links = new ReflectionMethod( $this->list_table, 'get_views_links' ); 146 163 $get_views_links->setAccessible( true ); 147 164 148 $actual = $get_views_links->invokeArgs( self::$list_table, array( $link_data ) );165 $actual = $get_views_links->invokeArgs( $this->list_table, array( $link_data ) ); 149 166 150 167 $this->assertSameSetsWithIndex( $expected, $actual ); … … 258 275 */ 259 276 public function test_get_views_links_doing_it_wrong( $link_data ) { 260 $get_views_links = new ReflectionMethod( self::$list_table, 'get_views_links' );277 $get_views_links = new ReflectionMethod( $this->list_table, 'get_views_links' ); 261 278 $get_views_links->setAccessible( true ); 262 $get_views_links->invokeArgs( self::$list_table, array( $link_data ) );279 $get_views_links->invokeArgs( $this->list_table, array( $link_data ) ); 263 280 } 264 281
Note: See TracChangeset
for help on using the changeset viewer.