<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[53564] trunk/tests/phpunit/tests: Build/Test Tools: Add missing @covers tags and fix the docs for the Cron test group.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/53564">53564</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/53564","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>azaozz</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2022-06-23 20:41:22 +0000 (Thu, 23 Jun 2022)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Build/Test Tools: Add missing @covers tags and fix the docs for the Cron test group.
Props pbeane, hellofromTonya, antonvlasenko, ironprogrammer, SergeyBiryukov, costdev.
See <a href="https://core.trac.wordpress.org/ticket/39265">#39265</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktestsphpunittestscronsetCronArrayphp">trunk/tests/phpunit/tests/cron/setCronArray.php</a></li>
<li><a href="#trunktestsphpunittestscronphp">trunk/tests/phpunit/tests/cron.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunktestsphpunittestscronsetCronArrayphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/cron/setCronArray.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/cron/setCronArray.php 2022-06-23 20:34:26 UTC (rev 53563)
+++ trunk/tests/phpunit/tests/cron/setCronArray.php 2022-06-23 20:41:22 UTC (rev 53564)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -24,9 +24,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Tests the input validation for the `_set_cron_array()` function.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Includes verifying that invalid input - typically `false` - does not result in a PHP
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * deprecation notice on PHP 8.1 or higher.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * deprecation warning on PHP 8.1 or higher.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The notice that we should not see:
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The warning that we should not see:
</ins><span class="cx" style="display: block; padding: 0 10px"> * `Deprecated: Automatic conversion of false to array is deprecated`.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 53635
</span></span></pre></div>
<a id="trunktestsphpunittestscronphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/cron.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/cron.php 2022-06-23 20:34:26 UTC (rev 53563)
+++ trunk/tests/phpunit/tests/cron.php 2022-06-23 20:41:22 UTC (rev 53564)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,6 +30,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> parent::tear_down();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_get_schedule
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_wp_get_schedule_empty() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Nothing scheduled.
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,6 +39,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_get_schedule( $hook ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_schedule_single_event
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_schedule_event_single() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Schedule an event and make sure it's returned by wp_next_scheduled().
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,6 +56,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_schedule_single_event
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_schedule_event_single_args() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Schedule an event with arguments and make sure it's returned by wp_next_scheduled().
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = 'event';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -68,6 +77,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_get_schedule( $hook, $args ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_schedule_event
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_schedule_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Schedule an event and make sure it's returned by wp_next_scheduled().
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,6 +94,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $recur, wp_get_schedule( $hook ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_schedule_event
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_schedule_event_args() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Schedule an event and make sure it's returned by wp_next_scheduled().
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = 'event';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -102,9 +117,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Tests that a call to wp_schedule_event() on a site without any scheduled events
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * does not result in a PHP deprecation notice on PHP 8.1 or higher.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * does not result in a PHP deprecation warning on PHP 8.1 or higher.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * The notice that we should not see:
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The warning that we should not see:
</ins><span class="cx" style="display: block; padding: 0 10px"> * `Deprecated: Automatic conversion of false to array is deprecated`.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 53635
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -111,7 +126,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_schedule_event
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- public function test_wp_schedule_event_without_cron_option_does_not_throw_deprecation_notice() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_wp_schedule_event_without_cron_option_does_not_throw_warning() {
</ins><span class="cx" style="display: block; padding: 0 10px"> delete_option( 'cron' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Verify that the cause of the error is in place.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,6 +163,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertNotContains( false, get_option( 'cron' ), 'Resulting cron array contains the value "false"' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_unschedule_event
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_unschedule_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Schedule an event and make sure it's returned by wp_next_scheduled().
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -162,6 +180,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_next_scheduled( $hook ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_clear_scheduled_hook
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_clear_schedule() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array( 'arg1' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,6 +210,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_next_scheduled( $hook, $args ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_clear_scheduled_hook
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_clear_undefined_schedule() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array( 'arg1' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -201,6 +225,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( 0, $hook_unscheduled );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_clear_scheduled_hook
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_clear_schedule_multiple_args() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array( 'arg1', 'arg2' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,6 +256,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 10468
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_clear_scheduled_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_clear_schedule_new_args() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -267,6 +296,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 18997
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_unschedule_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_unschedule_hook() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -288,6 +319,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_next_scheduled( $hook ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_unschedule_hook
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_unschedule_undefined_hook() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="cx" style="display: block; padding: 0 10px"> $unrelated_hook = __FUNCTION__ . '_two';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -308,6 +342,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 6966
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_duplicate_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Duplicate events close together should be skipped.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -331,6 +367,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 6966
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_not_duplicate_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Duplicate events far apart should work normally.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -351,6 +389,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertSame( $ts1, wp_next_scheduled( $hook, $args ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @covers ::wp_schedule_single_event
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function test_not_duplicate_event_reversed() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Duplicate events far apart should work normally regardless of order.
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -375,6 +416,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * modification of the cron_array_option.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 32656
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
+ * @covers ::wp_schedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_pre_schedule_event_filter() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -427,6 +471,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * modification of the cron_array_option.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 32656
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_reschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_pre_reschedule_event_filter() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -451,6 +497,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * modification of the cron_array_option.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 32656
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_unschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_pre_unschedule_event_filter() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -475,6 +523,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * modification of the cron_array_option.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 32656
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_clear_scheduled_hook
+ * @covers ::wp_unschedule_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_pre_clear_scheduled_hook_filters() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -506,6 +557,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * return a filtered value as expected.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 32656
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_get_scheduled_event
+ * @covers ::wp_next_scheduled
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_pre_scheduled_event_hooks() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_get_scheduled_event', array( $this, 'filter_pre_scheduled_event_hooks' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -540,6 +594,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * When a timestamp is specified, a particular event should be returned.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 45976.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_get_scheduled_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_scheduled_event_singles() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -583,6 +639,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * When a timestamp is specified, a particular event should be returned.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 45976.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_get_scheduled_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_scheduled_event_recurring() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -627,6 +685,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Ensure wp_get_scheduled_event() returns false when expected.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 45976.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_get_scheduled_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_get_scheduled_event_false() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -652,6 +712,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Ensure any past event counts as a duplicate.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 44818
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_duplicate_past_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -679,6 +741,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Ensure any near future event counts as a duplicate.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 44818
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_duplicate_near_future_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -707,6 +771,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Duplicate future events are disallowed.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 44818
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_duplicate_future_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -731,6 +797,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Future events are allowed.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 44818
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_not_duplicate_future_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> $hook = __FUNCTION__;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -749,6 +817,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
+ * @covers ::wp_schedule_event
+ * @covers ::wp_reschedule_event
+ * @covers ::wp_unschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_invalid_timestamp_for_event_returns_error() {
</span><span class="cx" style="display: block; padding: 0 10px"> $single_event = wp_schedule_single_event( -50, 'hook', array(), true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -771,6 +844,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_event
+ * @covers ::wp_reschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_invalid_recurrence_for_event_returns_error() {
</span><span class="cx" style="display: block; padding: 0 10px"> $event = wp_schedule_event( time(), 'invalid', 'hook', array(), true );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -785,6 +861,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
+ * @covers ::wp_schedule_event
+ * @covers ::wp_reschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_disallowed_event_returns_false_when_wp_error_is_set_to_false() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'schedule_event', '__return_false' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -800,6 +880,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
+ * @covers ::wp_schedule_event
+ * @covers ::wp_reschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_disallowed_event_returns_error_when_wp_error_is_set_to_true() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'schedule_event', '__return_false' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -820,6 +904,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
+ * @covers ::wp_schedule_event
+ * @covers ::wp_reschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_schedule_short_circuit_with_error_returns_false_when_wp_error_is_set_to_false() {
</span><span class="cx" style="display: block; padding: 0 10px"> $return_error = function( $pre, $event, $wp_error ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -848,6 +936,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
+ * @covers ::wp_schedule_event
+ * @covers ::wp_reschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_schedule_short_circuit_with_error_returns_error_when_wp_error_is_set_to_true() {
</span><span class="cx" style="display: block; padding: 0 10px"> $return_error = function( $pre, $event, $wp_error ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -881,6 +973,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
+ * @covers ::wp_schedule_event
+ * @covers ::wp_reschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_schedule_short_circuit_with_false_returns_false_when_wp_error_is_set_to_false() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Add filters which return false:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -900,6 +996,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
+ * @covers ::wp_schedule_event
+ * @covers ::wp_reschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_schedule_short_circuit_with_false_returns_error_when_wp_error_is_set_to_true() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Add filters which return false:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -925,6 +1025,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><span class="cx" style="display: block; padding: 0 10px"> * @expectedDeprecated wp_clear_scheduled_hook
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_clear_scheduled_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_deprecated_argument_usage_of_wp_clear_scheduled_hook() {
</span><span class="cx" style="display: block; padding: 0 10px"> $return_pre = function( $pre, $hook, $args, $wp_error ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -943,6 +1045,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_clear_scheduled_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_clear_scheduled_hook_returns_default_pre_filter_error_when_wp_error_is_set_to_true() {
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'pre_unschedule_event', '__return_false' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -964,6 +1068,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_clear_scheduled_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_clear_scheduled_hook_returns_custom_pre_filter_error_when_wp_error_is_set_to_true() {
</span><span class="cx" style="display: block; padding: 0 10px"> $return_error = function( $pre, $timestamp, $hook, $args, $wp_error ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -997,6 +1103,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_unschedule_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_unschedule_short_circuit_with_error_returns_false_when_wp_error_is_set_to_false() {
</span><span class="cx" style="display: block; padding: 0 10px"> $return_error = function( $pre, $hook, $wp_error ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1020,6 +1128,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_unschedule_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_unschedule_short_circuit_with_error_returns_error_when_wp_error_is_set_to_true() {
</span><span class="cx" style="display: block; padding: 0 10px"> $return_error = function( $pre, $hook, $wp_error ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1044,6 +1154,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_unschedule_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_unschedule_short_circuit_with_false_returns_false_when_wp_error_is_set_to_false() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Add a filter which returns false:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1058,6 +1170,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_unschedule_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_unschedule_short_circuit_with_false_returns_error_when_wp_error_is_set_to_true() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Add a filter which returns false:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1073,6 +1187,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_single_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_cron_array_error_is_returned_when_scheduling_single_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Force update_option() to fail by setting the new value to match the existing:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1093,6 +1209,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_schedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_cron_array_error_is_returned_when_scheduling_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Force update_option() to fail by setting the new value to match the existing:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1113,6 +1231,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_unschedule_hook
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_cron_array_error_is_returned_when_unscheduling_hook() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Schedule a valid event:
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1137,6 +1257,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 49961
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
+ * @covers ::wp_unschedule_event
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_cron_array_error_is_returned_when_unscheduling_event() {
</span><span class="cx" style="display: block; padding: 0 10px"> // Schedule a valid event:
</span></span></pre>
</div>
</div>
</body>
</html>