Skip to content

Commit f41d954

Browse files
Tests: Replace expectException() for PHP native errors with calls to the dedicated PHPUnit 8.4+ methods.
The old manner of testing these is soft deprecated as of PHPUnit 8.4, hard deprecated as of PHPUnit 9.0 and will be removed in PHPUnit 10.0. Most calls like this were already replaced in [51563], however, this particular one could not be changed yet due to the mismatch between the PHPUnit version and the PHP version on which the tests were being run. This is fixed now. References: * https://github.com/sebastianbergmann/phpunit/blob/8.4.3/ChangeLog-8.4.md#840---2019-10-04 * sebastianbergmann/phpunit#3775 Follow-up to [51559-51575]. Props jrf. See #46149. git-svn-id: https://develop.svn.wordpress.org/trunk@51576 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 36c997c commit f41d954

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

tests/phpunit/tests/dependencies/scripts.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,12 +1426,7 @@ public function test_wp_localize_script_data_formats( $l10n_data, $expected, $wa
14261426
if ( PHP_VERSION_ID < 80000 ) {
14271427
$this->expectWarning();
14281428
} else {
1429-
/*
1430-
* As this exception will only be set on PHP 8 in combination with PHPUnit 7, this will work (for now).
1431-
* Once the PHPUnit version constraints have been widened and a _supported_ PHPUnit version is
1432-
* used to run the tests on PHP 8.x, this should be changed to `$this->expectError()`.
1433-
*/
1434-
$this->expectException( 'Error' );
1429+
$this->expectError();
14351430
}
14361431
}
14371432

0 commit comments

Comments
 (0)