mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Tests: Replace assertRegExp() with assertMatchesRegularExpression().
The `assertRegExp()` and `assertNotRegExp()` methods were hard deprecated in PHPUnit 9.1 and the functionality will be removed in PHPUnit 10.0. The `assertMatchesRegularExpression()` and `assertDoesNotMatchRegularExpression()` methods were introduced as a replacement in PHPUnit 9.1. These new PHPUnit methods are polyfilled by the PHPUnit Polyfills and switching to them will future-proof the tests some more. References: * https://github.com/sebastianbergmann/phpunit/blob/9.1.5/ChangeLog-9.1.md#910---2020-04-03 * https://github.com/sebastianbergmann/phpunit/issues/4085 * https://github.com/sebastianbergmann/phpunit/issues/4088 Follow-up to [51559-51564]. Props jrf. See #46149. git-svn-id: https://develop.svn.wordpress.org/trunk@51565 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1207,7 +1207,7 @@ class Tests_Functions extends WP_UnitTestCase {
|
||||
$ids = array();
|
||||
for ( $i = 0; $i < 20; $i += 1 ) {
|
||||
$id = wp_unique_id( 'foo-' );
|
||||
$this->assertRegExp( '/^foo-\d+$/', $id );
|
||||
$this->assertMatchesRegularExpression( '/^foo-\d+$/', $id );
|
||||
$ids[] = $id;
|
||||
}
|
||||
$this->assertSame( $ids, array_unique( $ids ) );
|
||||
|
||||
Reference in New Issue
Block a user