mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Tests: Remove unexpected output in wp_dashboard_recent_drafts() tests on PHP 8.1.
This follows the approach used in other tests to let PHPUnit manage the output catching and effectively ignore the output until retrieving it later via `getActualOutput()`. Follow-up to [45505], [51968], [52173]. See #53635, #53363. git-svn-id: https://develop.svn.wordpress.org/trunk@52253 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f38f9b9971
commit
6717df2b48
@ -407,12 +407,17 @@ class Tests_L10n extends WP_UnitTestCase {
|
||||
|
||||
$this->factory()->post->create( $args );
|
||||
|
||||
// Effectively ignore the output until retrieving it later via `getActualOutput()`.
|
||||
$this->expectOutputRegex( '`.`' );
|
||||
|
||||
$expect = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do…';
|
||||
wp_dashboard_recent_drafts();
|
||||
|
||||
$actual = $this->getActualOutput();
|
||||
|
||||
restore_previous_locale();
|
||||
|
||||
$this->expectOutputRegex( '/' . $expect . '/' );
|
||||
$this->assertMatchesRegularExpression( '/' . $expect . '/', $actual );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -431,12 +436,17 @@ class Tests_L10n extends WP_UnitTestCase {
|
||||
|
||||
$post = $this->factory()->post->create( $args );
|
||||
|
||||
// Effectively ignore the output until retrieving it later via `getActualOutput()`.
|
||||
$this->expectOutputRegex( '`.`' );
|
||||
|
||||
$expect = 'Lorem ipsum dolor sit amet, consectetur …';
|
||||
wp_dashboard_recent_drafts();
|
||||
|
||||
$actual = $this->getActualOutput();
|
||||
|
||||
restore_previous_locale();
|
||||
|
||||
$this->expectOutputRegex( '/' . $expect . '/' );
|
||||
$this->assertMatchesRegularExpression( '/' . $expect . '/', $actual );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -455,12 +465,17 @@ class Tests_L10n extends WP_UnitTestCase {
|
||||
|
||||
$this->factory()->post->create( $args );
|
||||
|
||||
// Effectively ignore the output until retrieving it later via `getActualOutput()`.
|
||||
$this->expectOutputRegex( '`.`' );
|
||||
|
||||
$expect = str_repeat( 'あ', 40 ) . '…';
|
||||
wp_dashboard_recent_drafts();
|
||||
|
||||
$actual = $this->getActualOutput();
|
||||
|
||||
restore_previous_locale();
|
||||
|
||||
$this->expectOutputRegex( '/' . $expect . '/' );
|
||||
$this->assertMatchesRegularExpression( '/' . $expect . '/', $actual );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user