Changeset 60729 for trunk/tests/phpunit/tests/admin/wpMediaListTable.php
- Timestamp:
- 09/11/2025 02:45:56 PM (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/wpMediaListTable.php
r56141 r60729 77 77 self::$detached = new ReflectionProperty( self::$list_table, 'detached' ); 78 78 79 self::$is_trash->setAccessible( true ); 79 if ( PHP_VERSION_ID < 80100 ) { 80 self::$is_trash->setAccessible( true ); 81 } 80 82 self::$is_trash_original = self::$is_trash->getValue( self::$list_table ); 81 self::$is_trash->setAccessible( false ); 82 83 self::$detached->setAccessible( true ); 83 if ( PHP_VERSION_ID < 80100 ) { 84 self::$is_trash->setAccessible( false ); 85 } 86 87 if ( PHP_VERSION_ID < 80100 ) { 88 self::$detached->setAccessible( true ); 89 } 84 90 self::$detached_original = self::$detached->getValue( self::$list_table ); 85 self::$detached->setAccessible( false ); 91 if ( PHP_VERSION_ID < 80100 ) { 92 self::$detached->setAccessible( false ); 93 } 86 94 87 95 // Create users. … … 182 190 183 191 $_get_row_actions = new ReflectionMethod( self::$list_table, '_get_row_actions' ); 184 $_get_row_actions->setAccessible( true ); 192 if ( PHP_VERSION_ID < 80100 ) { 193 $_get_row_actions->setAccessible( true ); 194 } 185 195 $actions = $_get_row_actions->invoke( self::$list_table, self::$post, 'att_title' ); 186 $_get_row_actions->setAccessible( false ); 196 if ( PHP_VERSION_ID < 80100 ) { 197 $_get_row_actions->setAccessible( false ); 198 } 187 199 188 200 $this->assertIsArray( $actions, 'An array was not returned.' ); … … 263 275 264 276 $_get_row_actions = new ReflectionMethod( self::$list_table, '_get_row_actions' ); 265 $_get_row_actions->setAccessible( true ); 277 if ( PHP_VERSION_ID < 80100 ) { 278 $_get_row_actions->setAccessible( true ); 279 } 266 280 $actions = $_get_row_actions->invoke( self::$list_table, self::$post, 'att_title' ); 267 $_get_row_actions->setAccessible( false ); 281 if ( PHP_VERSION_ID < 80100 ) { 282 $_get_row_actions->setAccessible( false ); 283 } 268 284 269 285 $this->assertIsArray( $actions, 'An array was not returned.' ); … … 356 372 357 373 $_get_row_actions = new ReflectionMethod( self::$list_table, '_get_row_actions' ); 358 $_get_row_actions->setAccessible( true ); 374 if ( PHP_VERSION_ID < 80100 ) { 375 $_get_row_actions->setAccessible( true ); 376 } 359 377 $actions = $_get_row_actions->invoke( self::$list_table, self::$post, 'att_title' ); 360 $_get_row_actions->setAccessible( false ); 378 if ( PHP_VERSION_ID < 80100 ) { 379 $_get_row_actions->setAccessible( false ); 380 } 361 381 362 382 $this->assertIsArray( $actions, 'An array was not returned.' ); … … 375 395 376 396 $_get_row_actions = new ReflectionMethod( self::$list_table, '_get_row_actions' ); 377 $_get_row_actions->setAccessible( true ); 397 if ( PHP_VERSION_ID < 80100 ) { 398 $_get_row_actions->setAccessible( true ); 399 } 378 400 $actions = $_get_row_actions->invoke( self::$list_table, self::$attachment, 'att_title' ); 379 $_get_row_actions->setAccessible( false ); 401 if ( PHP_VERSION_ID < 80100 ) { 402 $_get_row_actions->setAccessible( false ); 403 } 380 404 381 405 $this->assertIsArray( $actions, 'An array was not returned.' ); … … 398 422 399 423 $_get_row_actions = new ReflectionMethod( self::$list_table, '_get_row_actions' ); 400 $_get_row_actions->setAccessible( true ); 424 if ( PHP_VERSION_ID < 80100 ) { 425 $_get_row_actions->setAccessible( true ); 426 } 401 427 $actions = $_get_row_actions->invoke( self::$list_table, self::$attachment, 'att_title' ); 402 $_get_row_actions->setAccessible( false ); 428 if ( PHP_VERSION_ID < 80100 ) { 429 $_get_row_actions->setAccessible( false ); 430 } 403 431 404 432 $this->assertIsArray( $actions, 'An array was not returned.' ); … … 415 443 public function test_get_row_actions_should_include_download() { 416 444 $_get_row_actions = new ReflectionMethod( self::$list_table, '_get_row_actions' ); 417 $_get_row_actions->setAccessible( true ); 445 if ( PHP_VERSION_ID < 80100 ) { 446 $_get_row_actions->setAccessible( true ); 447 } 418 448 $actions = $_get_row_actions->invoke( self::$list_table, self::$attachment, 'att_title' ); 419 $_get_row_actions->setAccessible( false ); 449 if ( PHP_VERSION_ID < 80100 ) { 450 $_get_row_actions->setAccessible( false ); 451 } 420 452 421 453 $this->assertIsArray( $actions, 'An array was not returned.' ); … … 436 468 437 469 $_get_row_actions = new ReflectionMethod( self::$list_table, '_get_row_actions' ); 438 $_get_row_actions->setAccessible( true ); 470 if ( PHP_VERSION_ID < 80100 ) { 471 $_get_row_actions->setAccessible( true ); 472 } 439 473 $actions = $_get_row_actions->invoke( self::$list_table, self::$attachment, 'att_title' ); 440 $_get_row_actions->setAccessible( false ); 474 if ( PHP_VERSION_ID < 80100 ) { 475 $_get_row_actions->setAccessible( false ); 476 } 441 477 442 478 $this->assertIsArray( $actions, 'An array was not returned.' ); … … 452 488 */ 453 489 private static function set_is_trash( $is_trash ) { 454 self::$is_trash->setAccessible( true ); 490 if ( PHP_VERSION_ID < 80100 ) { 491 self::$is_trash->setAccessible( true ); 492 } 455 493 self::$is_trash->setValue( self::$list_table, $is_trash ); 456 self::$is_trash->setAccessible( false ); 494 if ( PHP_VERSION_ID < 80100 ) { 495 self::$is_trash->setAccessible( false ); 496 } 457 497 } 458 498 … … 465 505 */ 466 506 private static function set_detached( $detached ) { 467 self::$detached->setAccessible( true ); 507 if ( PHP_VERSION_ID < 80100 ) { 508 self::$detached->setAccessible( true ); 509 } 468 510 self::$detached->setValue( self::$list_table, $detached ); 469 self::$detached->setAccessible( false ); 511 if ( PHP_VERSION_ID < 80100 ) { 512 self::$detached->setAccessible( false ); 513 } 470 514 } 471 515 }
Note:
See TracChangeset
for help on using the changeset viewer.