Skip to content

Commit 074fe8f

Browse files
committed
Tests: Make cron data providers static.
Declare the five data providers in `tests/phpunit/tests/cron.php` and `tests/phpunit/tests/cron/` as `public static` for compatibility with newer PHPUnit versions. Preserve their datasets and assertions. Developed in: #14028 Props therssoftware, mukesh27. See #66211. git-svn-id: https://develop.svn.wordpress.org/trunk@64262 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 9b2abab commit 074fe8f

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎tests/phpunit/tests/cron.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ public function test_wp_reschedule_event_works_with_args( array $args ) {
10601060
*
10611061
* @return array[]
10621062
*/
1063-
public function data_wp_reschedule_event_works_with_args() {
1063+
public static function data_wp_reschedule_event_works_with_args() {
10641064
return array(
10651065
'indexed' => array(
10661066
array(

‎tests/phpunit/tests/cron/getCronArray.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function test_get_cron_array_output_validation( $input, $expected ) {
5656
*
5757
* @return array
5858
*/
59-
public function data_get_cron_array_output_validation() {
59+
public static function data_get_cron_array_output_validation() {
6060
return array(
6161
'stdClass' => array(
6262
'input' => new stdClass(),

‎tests/phpunit/tests/cron/setCronArray.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function test_set_cron_array_input_validation( $input, $expected ) {
5151
*
5252
* @return array
5353
*/
54-
public function data_set_cron_array_input_validation() {
54+
public static function data_set_cron_array_input_validation() {
5555
return array(
5656
'null' => array(
5757
'input' => null,
@@ -101,7 +101,7 @@ public function test_set_cron_array_returns_false_when_not_updated( $input, $wp_
101101
*
102102
* @return array
103103
*/
104-
public function data_set_cron_array_returns_false_when_not_updated() {
104+
public static function data_set_cron_array_returns_false_when_not_updated() {
105105
return array(
106106
'empty array' => array(
107107
'input' => array(),
@@ -135,7 +135,7 @@ public function test_set_cron_array_returns_WP_Error_when_not_updated( $input, $
135135
*
136136
* @return array
137137
*/
138-
public function data_set_cron_array_returns_WP_Error_when_not_updated() {
138+
public static function data_set_cron_array_returns_WP_Error_when_not_updated() {
139139
return array(
140140
'empty array' => array(
141141
'input' => array(),

0 commit comments

Comments
 (0)