This replaces instances of `assertTrue( is_object( ... ) )` with `assertIsObject()` to use native PHPUnit functionality.
Follow-up to [51331], [51335].
See #53363.
git-svn-id: https://develop.svn.wordpress.org/trunk@51337 602fd350-edb4-49c9-b593-d223f7449a82
This replaces instances of `assertTrue( is_array( ... ) )` with `assertIsArray()` to use native PHPUnit functionality.
Follow-up to [51331].
See #53363.
git-svn-id: https://develop.svn.wordpress.org/trunk@51335 602fd350-edb4-49c9-b593-d223f7449a82
The `assertInternalType()` and `assertNotInternalType()` methods are deprecated in PHPUnit 8 and removed in PHPUnit 9.
While WordPress test suite currently only supports PHPUnit up to 7.5.x, this allows us to switch to newer assertions ahead of adding full support for PHPUnit 8+.
These methods introduced in PHPUnit 7.5 should be used as an alternative:
* `assertIsArray()`
* `assertIsBool()`
* `assertIsFloat()`
* `assertIsInt()`
* `assertIsNumeric()`
* `assertIsObject()`
* `assertIsResource()`
* `assertIsString()`
* `assertIsScalar()`
* `assertIsCallable()`
* `assertIsIterable()`
* `assertIsNotArray()`
* `assertIsNotBool()`
* `assertIsNotFloat()`
* `assertIsNotInt()`
* `assertIsNotNumeric()`
* `assertIsNotObject()`
* `assertIsNotResource()`
* `assertIsNotString()`
* `assertIsNotScalar()`
* `assertIsNotCallable()`
* `assertIsNotIterable()`
As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods are now added to the `WP_UnitTestCase` class for PHPUnit < 7.5.
Props pbearne, jrf, dd32, SergeyBiryukov.
Fixes#53491. See #46149.
git-svn-id: https://develop.svn.wordpress.org/trunk@51331 602fd350-edb4-49c9-b593-d223f7449a82
Add missing `@since` tags for some functions.
Correct alignment of some `@param` tags.
Follow-up to [46271], [46278], [51304].
See #52628, #53461.
git-svn-id: https://develop.svn.wordpress.org/trunk@51322 602fd350-edb4-49c9-b593-d223f7449a82
WordPress can be confident that WordPress functions exist.
I forgot this function existed.
And I thought that it would fatal, but it didn't
And it was so nice
So peaceful and quiet
I forgot this function existed
It isn't love, it isn't hate, it's just indifference
Introduced in [51003].
Props walbo.
Fixes#53578. See #53176.
git-svn-id: https://develop.svn.wordpress.org/trunk@51321 602fd350-edb4-49c9-b593-d223f7449a82
This fixes the logic in `wp_enqueue_global_styles()` to ensure that global styles are loaded in the footer when a site opts-in to loading Core block assets individually.
This fixes a bug where styles defined in `themes.json` are not respected.
Props walbo, nosolosw, mcsf, aristath, desrosj.
Fixes#53494.
git-svn-id: https://develop.svn.wordpress.org/trunk@51309 602fd350-edb4-49c9-b593-d223f7449a82
Because the `__()` translation function was used here, the Query block pattern category string is not translatable. `_x()` is the correct function here as that passes the second parameter as context and not text domain.
Follow up to [50948].
Props walbo.
Fixes#53577.
git-svn-id: https://develop.svn.wordpress.org/trunk@51307 602fd350-edb4-49c9-b593-d223f7449a82
Tests are contained within `direct` and `async` properties of this array, not directly in the array itself. This also clarifies the properties that differ between direct and async tests.
See #53399, #46573
git-svn-id: https://develop.svn.wordpress.org/trunk@51297 602fd350-edb4-49c9-b593-d223f7449a82
* Remove unnecessary `@access` tags that were previously removed from core.
* Remove an empty line between `@param` and `@return` tags.
* Correct alignment of `@param` tags.
Follow-up to [41161], [41162], [41168], [49216], [49220].
See #52628, #53461.
git-svn-id: https://develop.svn.wordpress.org/trunk@51294 602fd350-edb4-49c9-b593-d223f7449a82
Synchronize documentation for related `rest_{$object_type}_query` filters for consistency.
Props dlh.
Fixes#53568.
git-svn-id: https://develop.svn.wordpress.org/trunk@51293 602fd350-edb4-49c9-b593-d223f7449a82
Additionally:
* Remove an empty line between `@param` and `@return` tags.
* Correct alignment of `@param` tags.
Follow-up to [50959], [50973], [51149], [51284], [51289].
See #52628, #53461.
git-svn-id: https://develop.svn.wordpress.org/trunk@51292 602fd350-edb4-49c9-b593-d223f7449a82
This brings some consistency with other instances of using `get_post_stati()` in core.
`get_post_stati()` always returns an array, so the type casting is not needed.
Follow-up to [13172].
See #53359.
git-svn-id: https://develop.svn.wordpress.org/trunk@51285 602fd350-edb4-49c9-b593-d223f7449a82
Docs: Update syntax for multi-line comments per the documentation standards.
Follow-up to [50959], [50967], [50973], [51051], [51089], [51149].
See #52628, #53461.
git-svn-id: https://develop.svn.wordpress.org/trunk@51283 602fd350-edb4-49c9-b593-d223f7449a82
This resets the `WP_Widget::$updated` flag when deleting a widget, to avoid blocking all future updates in a request.
Props noisysocks, andraganescu.
Fixes#53557.
git-svn-id: https://develop.svn.wordpress.org/trunk@51277 602fd350-edb4-49c9-b593-d223f7449a82
When querying multiple post types, check the `read_private_posts` capability for each post type when determining which post statuses to return. This ensures private posts appear in search results and archives for users permitted to read them.
Props leogermani, hellofromTonya, jeffpaul, peterwilsoncc.
Fixes#48556.
git-svn-id: https://develop.svn.wordpress.org/trunk@51276 602fd350-edb4-49c9-b593-d223f7449a82
[51259] introduced a PHP notice that was not actually fixed by [51265]. Reverting these changes in order to investigate further.
See #53397.
git-svn-id: https://develop.svn.wordpress.org/trunk@51268 602fd350-edb4-49c9-b593-d223f7449a82
This fixes a PHP notice caused by the `viewScript` for the `core/file` block having `.min.js` instead of just `.js`.
`register_block_script_handle()` was incorrectly looking for `view.min.asset.php`, which does not exist, and caused the `_doing_it_wrong()` notice.
This adds a check for `.min.js` in the `viewScript` field of `block.json` and corrects it to `.js` in order to match the expected pattern of `view.asset.php` until a more permanent fix can be created.
Follow up to [51259].
Props ipstenu, pbiron, peterwilsoncc.
See #53397.
git-svn-id: https://develop.svn.wordpress.org/trunk@51267 602fd350-edb4-49c9-b593-d223f7449a82