wordpress-develop/tests/phpunit/tests
Tonya Mork da835d6627 Code Modernization: Add input validation to _set_cron_array().
The private `_set_cron_array()` function expects a cron array as the first parameter, but will often be passed the - potentially updated - output of a call to `_get_cron_array()`.

When the `_get_cron_array()` function returns `false`, a "Deprecated: Automatic conversion of false to array is deprecated" warning will be thrown on PHP 8.1.

The input validation resolves the deprecation warning by setting the cron value to an empty array when not given an `array` data type.

Adds a full set of `_set_cron_array()` tests.

Follow-up to [4189], [50152].

Props jrf, hellofromTonya, peterwilsoncc.
See #53635.

git-svn-id: https://develop.svn.wordpress.org/trunk@51695 602fd350-edb4-49c9-b593-d223f7449a82
2021-08-30 15:19:38 +00:00
..
actions Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
admin Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
ajax Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
attachment Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
blocks Editor: Ensure block attribute serialization in PHP matches the JavaScript equivalent. 2021-08-26 19:09:16 +00:00
bookmark Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
canonical Code Modernization: Replace strftime() and gmstrftime() usage in unit tests. 2021-08-09 19:08:09 +00:00
category Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
comment Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
cron Code Modernization: Add input validation to _set_cron_array(). 2021-08-30 15:19:38 +00:00
customize Tests: Remove use of assertArraySubset() in Test_WP_Widget_Media::test_constructor(). 2021-08-07 10:40:44 +00:00
date Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
db Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
dependencies Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
editor Tests: Rename classes in phpunit/tests/editor/ per the naming conventions. 2021-08-20 16:11:04 +00:00
error-protection Tests: Rename classes in phpunit/tests/error-protection/ per the naming conventions. 2021-08-21 15:32:53 +00:00
external-http Tests: Add missing @covers tags for files in phpunit/tests/external-http/. 2021-02-11 20:53:51 +00:00
feed Tests: Rename classes in phpunit/tests/feed/ per the naming conventions. 2021-08-22 10:07:17 +00:00
filesystem Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
formatting Code Modernization: Correct handling of null in wp_parse_str(). 2021-08-16 22:16:32 +00:00
functions Coding Standards: Add missing visibility keywords for wp_filter_object_list() and wp_list_pluck() tests. 2021-08-26 16:50:02 +00:00
general Code Modernization: Rename the readonly() function to wp_readonly(). 2021-08-09 17:19:21 +00:00
hooks Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
http Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
image Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
import Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
includes Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
l10n Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
link Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
load Multisite: Log error/warnings/notices from ms-files.php. 2021-07-06 20:20:51 +00:00
media Build/Test Tools: Replace assertInternalType() usage in unit tests. 2021-07-05 17:21:53 +00:00
menu Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
meta Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
multisite Code Modernization: Replace strftime() and gmstrftime() usage in unit tests. 2021-08-09 19:08:09 +00:00
oembed Code Modernization: Replace strftime() and gmstrftime() usage in unit tests. 2021-08-09 19:08:09 +00:00
option Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
pomo Tests: Move loading the PO class to set_up_before_class(). 2021-08-17 20:01:15 +00:00
post Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
privacy Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
query Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
rest-api Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
rewrite Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
sitemaps Tests: Rename classes in phpunit/tests/sitemaps/ per the naming conventions. 2021-07-26 19:09:41 +00:00
taxonomy Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
term Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
theme Blocks: Add support for variations in block.json` file 2021-08-11 09:06:31 +00:00
url Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
user Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
widgets Tests: Remove use of assertArraySubset() in Test_WP_Widget_Media::test_constructor(). 2021-08-07 10:40:44 +00:00
wp Code Modernization: Check the return type of parse_url() in WP::parse_request(). 2021-08-16 20:16:13 +00:00
xmlrpc Code Modernization: Replace strftime() and gmstrftime() usage in unit tests. 2021-08-09 19:08:09 +00:00
actions.php Tests: Use more appropriate assertions in various tests. 2021-07-11 12:41:48 +00:00
adminbar.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
auth.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
avatar.php Tests: Replace assertRegExp() with assertMatchesRegularExpression(). 2021-08-06 21:52:06 +00:00
basic.php Build/Test Tools: Fix tests after [50185]. 2021-02-05 03:36:26 +00:00
block-template-utils.php Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
block-template.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
cache.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
canonical.php Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
category.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
comment-submission.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
comment.php Code Modernization: Replace strftime() and gmstrftime() usage in unit tests. 2021-08-09 19:08:09 +00:00
compat.php Code Modernization: Silence the deprecation warning for missing return type in phpunit/tests/compat.php. 2021-08-10 17:34:30 +00:00
cron.php Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
db.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
dbdelta.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
dependencies.php Tests: Use more appropriate assertions in various tests. 2021-07-10 11:15:44 +00:00
file.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
filters.php Tests: Use more appropriate assertions in various tests. 2021-07-11 12:41:48 +00:00
functions.php Media: Fix wp_unique_filename() to check for name collisions with all alternate file names when an image may be converted after uploading. This includes possible collinions with pre-existing images whose sub-sizes/thumbnails are regenerated. 2021-08-24 20:50:21 +00:00
https-detection.php Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
https-migration.php Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
kses.php Tests: Use more appropriate assertions in various tests. 2021-07-10 11:15:44 +00:00
l10n.php Tests: Replace assertContains() with assertStringContainsString() when used with strings. 2021-07-19 14:00:11 +00:00
link.php Code Modernization: Replace strftime() and gmstrftime() usage in unit tests. 2021-08-09 19:08:09 +00:00
locale.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
mail.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
media.php Code Modernization: Replace strftime() and gmstrftime() usage in unit tests. 2021-08-09 19:08:09 +00:00
meta.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
multisite.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
pluggable.php Tests: Use more appropriate assertions in various tests. 2021-07-12 10:35:44 +00:00
post.php Code Modernization: Replace strftime() and gmstrftime() usage in unit tests. 2021-08-09 19:08:09 +00:00
query.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
rest-api.php REST API: Remove trailing slashes when preloading requests and add unit tests for it. 2021-08-20 23:43:21 +00:00
rewrite.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
robots.php Coding Standards: Use static closures when not using $this. 2021-08-26 12:57:08 +00:00
shortcode.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
site-health.php Build/Test Tools: Standardise the name, signature, and usage of the wpSetUpBeforeClass() method that's used in test classes. 2020-11-15 13:59:32 +00:00
taxonomy.php Tests: Use more appropriate assertions in various tests. 2021-07-15 14:44:22 +00:00
template.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
term.php Tests: Use more appropriate assertions in various tests. 2021-07-18 14:10:24 +00:00
theme.php Tests: Use more appropriate assertions in get_themes() tests. 2021-08-07 14:18:31 +00:00
upload.php Code Modernization: Replace strftime() and gmstrftime() usage in unit tests. 2021-08-09 19:08:09 +00:00
url.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
user.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
walker.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
widgets.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00
wp.php Build/Test Tools: Implement use of the void solution. 2021-08-07 10:29:41 +00:00