Changeset 54365
- Timestamp:
- 10/01/2022 03:47:13 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n.php
r54088 r54365 436 436 switch_to_locale( 'en_US' ); 437 437 438 /* 439 * The recent drafts list is only displayed on the Dashboard screen for users 440 * with the 'edit_posts' capability. 441 * 442 * This means the current user needs to be set to Editor as a prerequisite 443 * for the call to the wp_dashboard_recent_drafts() function. 444 * 445 * This allows the subsequent call to get_edit_post_link() to work as expected 446 * and return a string instead of null, which would otherwise cause a PHP 8.1 447 * "passing null to non-nullable" deprecation notice. 448 */ 449 wp_set_current_user( self::factory()->user->create( array( 'role' => 'editor' ) ) ); 450 438 451 $args = array( 439 452 'post_content' => $this->long_text, … … 462 475 switch_to_locale( 'ja_JP' ); 463 476 477 /* 478 * The recent drafts list is only displayed on the Dashboard screen for users 479 * with the 'edit_posts' capability. 480 * 481 * This means the current user needs to be set to Editor as a prerequisite 482 * for the call to the wp_dashboard_recent_drafts() function. 483 * 484 * This allows the subsequent call to get_edit_post_link() to work as expected 485 * and return a string instead of null, which would otherwise cause a PHP 8.1 486 * "passing null to non-nullable" deprecation notice. 487 */ 488 wp_set_current_user( self::factory()->user->create( array( 'role' => 'editor' ) ) ); 489 464 490 $args = array( 465 491 'post_content' => $this->long_text, … … 487 513 488 514 switch_to_locale( 'ja_JP' ); 515 516 /* 517 * The recent drafts list is only displayed on the Dashboard screen for users 518 * with the 'edit_posts' capability. 519 * 520 * This means the current user needs to be set to Editor as a prerequisite 521 * for the call to the wp_dashboard_recent_drafts() function. 522 * 523 * This allows the subsequent call to get_edit_post_link() to work as expected 524 * and return a string instead of null, which would otherwise cause a PHP 8.1 525 * "passing null to non-nullable" deprecation notice. 526 */ 527 wp_set_current_user( self::factory()->user->create( array( 'role' => 'editor' ) ) ); 489 528 490 529 $args = array(
Note: See TracChangeset
for help on using the changeset viewer.