This revision includes a change to only call `libxml_disable_entity_loader()` in PHP < 8, in order for unit tests in the `import` group to pass on PHP 8.
This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is disabled by default, so this function is no longer needed to protect against XXE attacks.
Follow-up to [46542], [48789].
Props jrf.
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49039 602fd350-edb4-49c9-b593-d223f7449a82
* Replace the `Match` interface with `ParametersMatch`, to avoid parse errors due to `match` being a reserved keyword in PHP 8.
* Replace `ReflectionParameter::getClass()` usage, which is deprecated in PHP 8.
This allows tests relying on the `getMockForAbstractClass()` and `getMockBuilder()` methods to run again on PHP 8.
When the test suite is updated for compatibility with PHPUnit 9.x, these overrides can be removed.
Follow-up to [48972].
See #50913, #50902.
git-svn-id: https://develop.svn.wordpress.org/trunk@49037 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a few PHP notices if the `include_selected` parameter was specified and a non-existing user ID was passed.
Props campusboy1987.
Fixes#51370.
git-svn-id: https://develop.svn.wordpress.org/trunk@49036 602fd350-edb4-49c9-b593-d223f7449a82
This outputs a proper message in case of failure, instead of an obscure PHP error further in the test.
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49032 602fd350-edb4-49c9-b593-d223f7449a82
This avoids an error on PHP 8 caused by passing an empty string to `array_merge()`, instead of an array.
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49026 602fd350-edb4-49c9-b593-d223f7449a82
These actions allow debugging tools to track `WP_Error` instances as they're created and subsequently passed between functions which check for error objects.
Props Shelob9, Mte90, TimothyBlynJacobs, johnbillion
Fixes#40568
git-svn-id: https://develop.svn.wordpress.org/trunk@49022 602fd350-edb4-49c9-b593-d223f7449a82
This brings continuity to all the image related functions and filters which accept or pass a size parameter.
Props dilipbheda, johnbillion
Fixes#47364
git-svn-id: https://develop.svn.wordpress.org/trunk@49021 602fd350-edb4-49c9-b593-d223f7449a82
This ensures the correct data properties are checked before displaying image thumbnails.
Props chetan200891
Fixes#49655
git-svn-id: https://develop.svn.wordpress.org/trunk@49012 602fd350-edb4-49c9-b593-d223f7449a82
This brings theme deletion inline with plugin deletion and theme and plugin editing, which can only be performed from within Network Admin.
Props Mista-Flo, williampatton, johnbillion
Fixes#41441
git-svn-id: https://develop.svn.wordpress.org/trunk@49011 602fd350-edb4-49c9-b593-d223f7449a82
This outputs a proper message if the requirement is not met, instead of an obscure PHP error further in the test.
See #50639, #50640.
git-svn-id: https://develop.svn.wordpress.org/trunk@49010 602fd350-edb4-49c9-b593-d223f7449a82
The explicit message brings some consistency with other image editor tests, specifically the ones using the `WP_Image_UnitTestCase` class.
Previously, the tests were marked as "risky" in that scenario, due to performing no assertions.
See #50639, #50640.
git-svn-id: https://develop.svn.wordpress.org/trunk@49009 602fd350-edb4-49c9-b593-d223f7449a82
The tests ensure that `rest_sanitize_value_from_schema()` and `rest_validate_value_from_schema()` throw an "undefined offset" notice when the required `type` schema keyword is not passed.
In PHP 8, that notice is now a warning, so the tests need to be adjusted accordingly.
Follow-up to [48300], [48993].
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49007 602fd350-edb4-49c9-b593-d223f7449a82
Transitioning posts from `auto-draft` to `publish` via `wp_publish_post()` could result in published posts without the default category or custom taxonomy default terms.
Props frank-klein, TimothyBlynJacobs, peterwilsoncc.
Fixes#51292.
git-svn-id: https://develop.svn.wordpress.org/trunk@49000 602fd350-edb4-49c9-b593-d223f7449a82
Previously, the test had to use an older pattern for catching the generic `Exception` exceptions for compatibility with PHPUnit 3.6 on PHP 5.2.
Now that WordPress supports PHPUnit 5.4 as the minimum version, the `expectException()` method can be used directly.
Follow-up to [41725], [41730].
See #51344.
git-svn-id: https://develop.svn.wordpress.org/trunk@48999 602fd350-edb4-49c9-b593-d223f7449a82
The test ensures that `WP_Locale::get_weekday()` throws an "undefined offset" notice when called with an incorrect `$weekday_number` parameter.
In PHP 8, that notice is now a warning, so the test needs to be adjusted accordingly.
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@48993 602fd350-edb4-49c9-b593-d223f7449a82
This avoids the performance overhead of calling `WP_Comment_Query::get_comments()` twice: first when creating the object instance, then to retrieve the filtered results.
This also makes the filter a bit more consistent with other similar filters, e.g. `posts_pre_query`, `terms_pre_query`, or `users_pre_query`.
Follow-up to [46086].
Props dinhtungdu, imath, spacedmonkey, adamsilverstein, SergeyBiryukov.
Fixes#50521.
git-svn-id: https://develop.svn.wordpress.org/trunk@48990 602fd350-edb4-49c9-b593-d223f7449a82