| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
| |
Follow-up to [51960].
Props nareshbheda.
Fixes #63343.
git-svn-id: https://develop.svn.wordpress.org/trunk@60185 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
| |
See #62281
git-svn-id: https://develop.svn.wordpress.org/trunk@59896 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
hashing application passwords and security keys.
Passwords and security keys that were saved in prior versions of WordPress will continue to work. Each user's password will be opportunistically rehashed and resaved when they next subsequently log in using a valid password.
The following new functions have been introduced:
* `wp_password_needs_rehash()`
* `wp_fast_hash()`
* `wp_verify_fast_hash()`
The following new filters have been introduced:
* `password_needs_rehash`
* `wp_hash_password_algorithm`
* `wp_hash_password_options`
Props ayeshrajans, bgermann, dd32, deadduck169, desrosj, haozi, harrym, iandunn, jammycakes, joehoyle, johnbillion, mbijon, mojorob, mslavco, my1xt, nacin, otto42, paragoninitiativeenterprises, paulkevan, rmccue, ryanhellyer, scribu, swalkinshaw, synchro, th23, timothyblynjacobs, tomdxw, westi, xknown.
Additional thanks go to the Roots team, Soatok, Calvin Alkan, and Raphael Ahrens.
Fixes #21022, #44628
git-svn-id: https://develop.svn.wordpress.org/trunk@59828 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
| |
Syncs @wordpress/* packages to the 'latest' npm tag.
Props mamaduka, joemcgill, youknowriad, swissspidy, sergiomdgomes, gziolo.
See #62887.
git-svn-id: https://develop.svn.wordpress.org/trunk@59775 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The WordPress Importer plugin has been maintained separately in a repository on GitHub since 2016. However, the unit tests were left in wordpress-develop due to the lack of a CI setup on GitHub.
With GitHub Actions set up for the plugin repository, these tests are now running in two locations. Because they are more relevant to the plugin itself, the tests have been synced, will run weekly through a `schedule` event, and are now being removed from wordpress-develop.
The only remaining test method in the `import` group covers `get_importers()`, which is a function maintained in WordPress Core itself.
Props frank-klein, netweb, dd32, peterwilsoncc, azaozz, desrosj, swissspidy.
Fixes #42668.
git-svn-id: https://develop.svn.wordpress.org/trunk@59769 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
| |
requests.
While the `skipTestOnTimeout()` method will catch a timeout and prevent it from causing a test to fail, other errors such as a failed DNS lookup or HTTPS handshake can still cause a test to unnecessarily fail. This introduces a simple retry mechanism that will hopefully further reduce the flakiness of tests that perform HTTP API requests.
Fixes #62830
git-svn-id: https://develop.svn.wordpress.org/trunk@59729 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
| |
Adds a new `WP_PHPMailer` class to leverage the WordPress i18n system with PHPMailer, so that any user-visible error messages can be properly translated.
Props sukhendu2002, swissspidy, audrasjb, iandunn, nacin, mark-k.
Fixes #23311.
git-svn-id: https://develop.svn.wordpress.org/trunk@59592 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reverts an earlier change to the test suite in which the PHPUnit tests could not run if the importer plugin was not available.
This update allows the test suite to run and will fail importer tests if the plugin is not available.
Follow up to r59085.
Props peterwilsoncc, azaozz.
See #62325.
git-svn-id: https://develop.svn.wordpress.org/trunk@59326 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TestXMLParser::parse().
PHP 8.4 deprecates the use of `trigger_errror()` with `E_USER_ERROR` as the error level, as there are a number of gotchas to this way of creating a `Fatal Error` (`finally` blocks not executing, destructors not executing).
The recommended replacements are either to use exceptions or to do a hard `exit`.
As this is a test-only class, do not have to take BC-breaks into account.
Also, as this is a test helper, throwing a exception is the most appropriate solution.
Reference:
* https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error
Follow-up to [25002].
Props jrf.
See #62061.
git-svn-id: https://develop.svn.wordpress.org/trunk@59109 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
WP_Test_Stream::open().
PHP 8.4 deprecates the use of `trigger_errror()` with `E_USER_ERROR` as the error level, as there are a number of gotchas to this way of creating a `Fatal Error` (`finally` blocks not executing, destructors not executing).
The recommended replacements are either to use exceptions or to do a hard `exit`.
As this is a test-only class, do not have to take BC-breaks into account.
Also, as this is a test helper, throwing a exception is the most appropriate solution.
Reference:
* https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error
Follow-up to [49230].
Props jrf.
See #62061.
git-svn-id: https://develop.svn.wordpress.org/trunk@59108 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
core tests.
This allows other users of the WordPress unit test suite framework to run their own unit tests without needing the WordPress Importer plugin, which should only be a requirement if running core tests.
Follow-up to [59085].
Props bjorsch.
Fixes #62106.
git-svn-id: https://develop.svn.wordpress.org/trunk@59086 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test bootstrap.
If a hard requirement for the test suite is not fulfilled, running the tests should be blocked from the test bootstrap. A test should only fail when it doesn't produce the expected result.
Since the WordPress Importer plugin is considered a hard requirement for the test suite at this time, this commit moves the check whether the plugin is installed from individual tests to the test bootstrap.
Includes defining a global constant for the path to the file for reuse in the tests.
Reference: [https://make.wordpress.org/core/handbook/contribute/git/#unit-tests Core Contributor Handbook: The Code Repository (Git): Unit Tests].
Follow-up to [40531], [40532], [41090], [41169], [48592], [49535], [49571].
Props jrf, hellofromTonya.
See #61530.
git-svn-id: https://develop.svn.wordpress.org/trunk@59085 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `E_STRICT` constant is deprecated as of PHP 8.4 and will be removed in PHP 9.0.
The error level hasn't been in use since PHP 8.0 anyway, so removing the exclusion from the `error_reporting()` setting in the `install.php` script used in the tests should make no difference in practice.
Ref:
* https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant
Follow-up to [25002].
Props jrf.
See #62061.
git-svn-id: https://develop.svn.wordpress.org/trunk@59068 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduces `WP_UnitTestCase_Base::assertSamePathIgnoringDirectorySeparators()` and an associated helper method `WP_UnitTestCase_Base::normalizeDirectorySeparatorsInPath()` to allow for comparing two file path strings independently of OS-specific differences.
The normalization is done in a separate method to also allow this method to be used for path normalization within test methods themselves, like for normalizing a group of paths in an array.
The pretty specific method name for the helper (`normalizeDirectorySeparatorsInPath()`) is an attempt to prevent naming conflicts with methods which may exist in plugin test suites build on top of the WP Core test suite.
Props jrf, hellofromTonya.
See #61530.
git-svn-id: https://develop.svn.wordpress.org/trunk@59057 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The XML Parser extension still supports a quite dated mechanism for method based callbacks, where the object is first set via `xml_set_object()` and the callbacks are then set by passing only the name of the method to the relevant parameters on any of the `xml_set_*_handler()` functions.
{{{
xml_set_object( $parser, $my_obj );
xml_set_character_data_handler( $parser, 'method_name_on_my_obj' );
}}}
Passing proper callables to the `xml_set_*_handler()` functions has been supported for the longest time and is cross-version compatible. So the above code is 100% equivalent to:
{{{
xml_set_character_data_handler( $parser, [$my_obj, 'method_name_on_my_obj'] );
}}}
The mechanism of setting the callbacks with `xml_set_object()` has now been deprecated as of PHP 8.4, in favour of passing proper callables to the `xml_set_*_handler()` functions. This is also means that calling the `xml_set_object()` function is deprecated as well.
This commit fixes this deprecation for the `TestXMLParser` helper utility. In this case, the callbacks were already using the recommended format and the call to `xml_set_object()` was completely redundant.
As this is a test utility and was already causing pre-existing tests using the utility to fail, there is no need for dedicated tests to cover this change.
Refs:
* https://wiki.php.net/rfc/deprecations_php_8_4#xml_set_object_and_xml_set_handler_with_string_method_names
* https://www.php.net/manual/en/function.xml-set-object.php
* https://www.php.net/manual/en/ref.xml.php
Follow-up to [25002].
Props jrf.
See #62061.
git-svn-id: https://develop.svn.wordpress.org/trunk@59055 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
| |
When using the /posts or /pages endpoints, for private posts or pages, you get the following title property: { raw: "Some title", rendered: "Private: Some title" }
this commit removes the prefix from rendered private posts titles (just like what we do for protected posts)
Props youknowriad, swissspidy, timothyblynjacobs, sergeybiryukov, ramonopoly.
Fixes #61639.
git-svn-id: https://develop.svn.wordpress.org/trunk@58783 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
| |
See https://github.com/WordPress/wordpress-develop/pull/6773.
Fixes #61410.
Props vcanales.
git-svn-id: https://develop.svn.wordpress.org/trunk@58387 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
| |
Updates the editor npm packages to latest versions.
See https://github.com/WordPress/wordpress-develop/pull/6612.
Props ellatrix, mukesh27, youknowriad, mamaduka.
git-svn-id: https://develop.svn.wordpress.org/trunk@58187 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
| |
`WP_Test_REST_TestCase`.
All assertions in PHPUnit have a `$message` parameter. Setting this parameter allows to distinguish which assertion is failing when a test runs multiple assertions, making debugging of the tests easier.
Follow-up to [34928], [51478], [58039].
See #60426.
git-svn-id: https://develop.svn.wordpress.org/trunk@58051 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`WP_Test_REST_TestCase`.
All assertions in PHPUnit have a `$message` parameter. Setting this parameter allows to distinguish which assertion is failing when a test runs multiple assertions, making debugging of the tests easier.
This optional parameter is now added for `WP_Test_REST_TestCase::assertErrorResponse()`.
Follow-up to [34928], [51478].
Props mykolashlyakhtun, antonvlasenko, swissspidy, SergeyBiryukov.
Fixes #60426.
git-svn-id: https://develop.svn.wordpress.org/trunk@58039 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
| |
Props swissspidy, jucaduca, sergeybiryukov.
See #60699.
git-svn-id: https://develop.svn.wordpress.org/trunk@57987 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
| |
`rand_long_str()`.
Follow-up to [36272], [50265].
Props harsh175, sabernhardt.
Fixes #60401.
git-svn-id: https://develop.svn.wordpress.org/trunk@57749 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a bug introduced by [57129] and [56635] in which deprecating the previous `TEMPLATEPATH` and `STYLESHEETPATH` constants in favor of `get_template_directory()` and `get_stylesheet_directory()` functions caused the active theme template path to change when using `switch_to_blog()`.
This introduces a new function, `wp_set_template_globals()`, which is called during the bootstrap process to store the template paths to new globals values `$wp_template_path` and `$wp_stylesheet_path`. This restores behavior to how things worked prior to [56635] but retains the ability for template values to be reset for better testability.
Related #18298, #60025.
Props joemcgill, flixos90, mukesh27, swissspidy, manfcarlo, metropolis_john, jeremyfelt.
Fixes #60290.
git-svn-id: https://develop.svn.wordpress.org/trunk@57685 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
| |
Props mahnewr, rudlinkon,kraftbj, audrasjb, mukesh27.
Fixes #60513.
git-svn-id: https://develop.svn.wordpress.org/trunk@57665 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
| |
Use 'theme_files' cache group for block pattern caches. Previously, block pattern cache data was not stored in a cache group and used the default group. This new cache group, is setup as a global cache group, meaning that sites using multisite, will have a single cache for block pattern data per theme. This change also no longer invalidate block pattern caches in multisite instances, meaning block pattern caches can be shared between sites on a network, meaning less repeated data in the object cache.
Props spacedmonkey, flixos90, joemcgill.
Fixes #60120.
git-svn-id: https://develop.svn.wordpress.org/trunk@57608 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
| |
Audio and video attachments can have a featured image, also known as a poster image. This functionality is now properly exposed by the `wp/v2/media` endpoint.
Props swissspidy, timothyblynjacobs, wonderboymusic, dlh, spacedmonkey.
Fixes #41692.
git-svn-id: https://develop.svn.wordpress.org/trunk@57603 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
| |
This brings the latest and greatest from Gutenberg.
The full changelog is available here
https://github.com/WordPress/gutenberg/releases/tag/v17.7.0-rc.1
Props youknowriad, get_dave.
See #60315.
git-svn-id: https://develop.svn.wordpress.org/trunk@57578 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
| |
By default, users will see a tab in the editor indicating the possibility
to active Google Fonts and install Fonts from there.
Props youknowriad, get_dave, mcsf.
Fixes #59166.
git-svn-id: https://develop.svn.wordpress.org/trunk@57558 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces the Block Bindings API for WordPress.
The API allows developers to connects block attributes to different sources. In this PR, two such sources are included: "post meta" and "pattern". Attributes connected to sources can have their HTML replaced by values coming from the source in a way defined by the binding.
Props czapla, lgladdy, gziolo, sc0ttkclark, swissspidy, artemiosans, kevin940726, fabiankaegy, santosguillamot, talldanwp, wildworks.
Fixes #60282.
git-svn-id: https://develop.svn.wordpress.org/trunk@57514 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
git-svn-id: https://develop.svn.wordpress.org/trunk@57377 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
| |
This allows third-party plugins to write their own factory extending `WP_UnitTest_Factory` for testing purposes, as well as benefit from `WP_UnitTestCase_Base` features.
Follow-up to [35186], [35225], [35242].
Props hugod.
Fixes #59999.
git-svn-id: https://develop.svn.wordpress.org/trunk@57149 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
| |
is called.
Follow-up to [34928].
Props xknown, joemcgill.
Fixes #59601.
git-svn-id: https://develop.svn.wordpress.org/trunk@57133 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The npm packages needed update for 6.4 RC3.
Patch: https://github.com/WordPress/wordpress-develop/pull/5587.
This PR includes the following changes:
- Regression: [https://github.com/WordPress/gutenberg/pull/55553 Patterns: fix bug with authors and contributors not seeing user pattern categories].
- Bugfix: [https://github.com/WordPress/gutenberg/pull/55539 Query Loop:Disallow "enhanced pagination" with core blocks that may contain third-party blocks].
- Regression: [https://github.com/WordPress/gutenberg/pull/55667 File: Fix embedded PDF files in Safari].
- Regression: [https://github.com/WordPress/gutenberg/pull/55669 Ensure Term Description block is registered in core]
Props DAreRodz, luisherranz, poena, afercia, danieldudzic, hellofromtonya, siobhyb, mikachan, get_dave, scruffian, wildworks, glendaviesnz, ramonopoly, aaronrobertshaw.
See #59411.
git-svn-id: https://develop.svn.wordpress.org/trunk@57034 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The method attempted to check if there is already a file with the same name, however the conditional used an undefined variable.
This commit prevents directory creation if a file or directory with the same name already exists, bringing consistency with the PHP `mkdir()` implementation.
Includes adding missing documentation for the method.
Reference: [https://www.php.net/manual/en/streamwrapper.mkdir.php PHP Manual: streamWrapper::mkdir()].
Follow-up to [49230].
Props david.binda, sadizaman, rajinsharwar, SergeyBiryukov.
Fixes #59406.
git-svn-id: https://develop.svn.wordpress.org/trunk@56998 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
| |
Such `@return void` annotations must not be used in WordPress core's PHP code, except bundled themes, third-party libraries, and PHP compatibility shims.
Props isabel_brison, swissspidy.
Fixes #59619.
git-svn-id: https://develop.svn.wordpress.org/trunk@56943 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
| |
The npm packages needed updating for 6.4 to the latest.
Props mikachan, mukesdpanchal27, luisherranz, youknowriad, tellthemachines, gziolo, ockham, michalczaplinski
Fixes #59411
git-svn-id: https://develop.svn.wordpress.org/trunk@56710 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PHP 7.0 introduced the `$levels` parameter to the `dirname()` function, which means nested calls to `dirname()` are no longer needed.
Note: This is enforced by WPCS 3.0.0.
Reference: [https://www.php.net/manual/en/function.dirname.php PHP Manual: dirname()].
Follow-up to [56141].
Props jrf.
See #59161, #58831.
git-svn-id: https://develop.svn.wordpress.org/trunk@56552 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note: This is enforced by WPCS 3.0.0:
1. There should be no space between an increment/decrement operator and the variable it applies to.
2. Pre-increment/decrement should be favoured over post-increment/decrement for stand-alone statements. “Pre” will in/decrement and then return, “post” will return and then in/decrement. Using the “pre” version is slightly more performant and can prevent future bugs when code gets moved around.
References:
* [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#increment-decrement-operators WordPress PHP Coding Standards: Increment/decrement operators]
* [https://github.com/WordPress/WordPress-Coding-Standards/pull/2130 WPCS: PR #2130 Core: add sniffs to check formatting of increment/decrement operators]
Props jrf.
See #59161, #58831.
git-svn-id: https://develop.svn.wordpress.org/trunk@56549 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
functions.
Note: This is enforced by WPCS 3.0.0.
Follow-up to [56536], [56547].
Props jrf.
See #59161, #58831.
git-svn-id: https://develop.svn.wordpress.org/trunk@56548 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
| |
Note: This is enforced by WPCS 3.0.0.
Follow-up to [56536].
Props jrf.
See #59161, #58831.
git-svn-id: https://develop.svn.wordpress.org/trunk@56547 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
| |
Note: This is enforced by WPCS 3.0.0.
Props jrf.
See #59161, #58831.
git-svn-id: https://develop.svn.wordpress.org/trunk@56536 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
| |
The `mysql` extension is no longer used in PHP 7 or above. There's a good amount of conditional code in `wpdb` and the health checks that can be removed now that only the `mysqli` functions are used.
Fixes #59118
git-svn-id: https://develop.svn.wordpress.org/trunk@56475 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
| |
Props nekojonez.
See #58833.
git-svn-id: https://develop.svn.wordpress.org/trunk@56472 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
| |
Similar to other function in the `_deprecated_*` series, `_deprecated_class()` comes with two new hooks: `deprecated_class_run` and `deprecated_class_trigger_error`.
Support has also been added for setting class deprecation expectations in tests.
Props jrf, wvega, ohryan.
See #41125.
git-svn-id: https://develop.svn.wordpress.org/trunk@56467 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[https://github.com/sebastianbergmann/phpunit/blob/9.6/ChangeLog-9.6.md#961---2023-02-03 PHPUnit 9.6.1] deprecated the `assertObjectHasAttribute()` and `assertObjectNotHasAttribute()` methods, leading to deprecation notices in a number of tests.
[https://github.com/sebastianbergmann/phpunit/blob/10.1.3/ChangeLog-10.1.md#1010---2023-04-14 PHPUnit 10.1.0] brought the methods back by popular request, though renamed as `assertObjectHasProperty()` and `assertObjectNotHasProperty()`, to prevent confusion with PHP 8.0 attributes.
This meant that users which cannot (yet) upgrade to PHPUnit 10.1+ would always have deprecation notices for these methods without recourse. So, after much discussion, the new methods have been backported to [https://github.com/sebastianbergmann/phpunit/blob/9.6/ChangeLog-9.6.md#9611---2023-08-19 PHPUnit 9.6.11], leaving just the 10.0.x series with a deprecation notice and no recourse.
What does this mean for WordPress?
WordPress uses the [https://github.com/Yoast/PHPUnit-Polyfills PHPUnit Polyfills] to be able to write tests for the most recent versions of PHPUnit, with the Polyfills taking care of polyfilling any new PHPUnit methods on older PHPUnit versions.
* The PHPUnit Polyfills 1.x series supports PHPUnit 4.x to 9.x.
* The PHPUnit Polyfills 2.x series supports PHPUnit 5.x to 10.x.
WordPress currently runs against PHPUnit 6.x to 9.x with PHPUnit Polyfills 1.x, while the new methods were previously only included in PHPUnit Polyfills 2.0.0+, as they were introduced in PHPUnit 10.x.
Since the `assertObjectHasProperty()` and `assertObjectNotHasProperty()` methods have been backported to PHPUnit 9.x, the PHPUnit Polyfills will now include these methods in the 1.x series as well.
By upgrading to the latest [https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/1.1.0 PHPUnit Polyfills 1.1.0] release, we can get rid of the deprecation notices related to the use of the `assertObjectHasAttribute()` and `assertObjectNotHasAttribute()` methods.
This could have implications for plugins or themes running integration tests with WordPress if they have set their PHPUnit Polyfills dependency to a fixed version or have a too strict version constraint (limiting the PHPUnit Polyfills to the 1.0.x series). The solution for those plugins or themes is to update their version constraints for the PHPUnit Polyfills to allow for the 1.1.x series.
Follow-up to [51559], [51598].
Props jrf, ayeshrajans.
Fixes #59150.
git-svn-id: https://develop.svn.wordpress.org/trunk@56421 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
| |
This is a micro-optimization that removes a few unnecessary function calls.
Follow-up to [31188], [34369], [38986], [41159], [43211], [43230], [44606], [45757].
Props ayeshrajans, jrf, rajinsharwar, costdev, mukesh27, SergeyBiryukov.
Fixes #58943.
git-svn-id: https://develop.svn.wordpress.org/trunk@56352 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
| |
This resets the main query variable, `$wp_the_query` during the `WP_UnitTestCase_Base::tear_down` method that runs after each PHPUnit test. This ensures any changes to the main query object is reset after each test to avoid cross contamination between tests, similar to how other globals are reset.
Props flixos90, spacedmonkey, joemcgill.
Fixes #58776.
git-svn-id: https://develop.svn.wordpress.org/trunk@56212 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix deprecation warning for dynamic property in object cache drop-in used in core unit tests.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.
Props spacedmonkey, johnbillion.
Fixes #58736.
See #56034.
git-svn-id: https://develop.svn.wordpress.org/trunk@56161 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
| |
Updates the wordpress npm packages and their dependencies to the latest versions, as well as auto-updates to relevant core PHP files.
Props youknowriad, joemcgill, spacedmonkey, ramonopoly, peterwilsoncc, bernhard-reiter, tyxla, dmsnell.
Fixes #58623.
git-svn-id: https://develop.svn.wordpress.org/trunk@56065 602fd350-edb4-49c9-b593-d223f7449a82
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `usermeta` group was introduced in WP 2.0, but was never actually used in WordPress core.
The `user_meta` group is used instead.
Follow-up to [3011], [15482], [16562], [53823], [53832], [54940].
Props ignatggeorgiev, peterwilsoncc, oglekler, pamprn09, spacedmonkey, SergeyBiryukov.
Fixes #58175.
git-svn-id: https://develop.svn.wordpress.org/trunk@55940 602fd350-edb4-49c9-b593-d223f7449a82
|