Skip to content

Commit

Permalink
Tests: make dataproviders static
Browse files Browse the repository at this point in the history
As of PHPUnit 10, data providers are (again) expected to be `static` methods.

This updates the test suite to respect that.
  • Loading branch information
jrfnl committed Sep 26, 2023
1 parent 54900d1 commit 5df8d9d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/MessageDismisserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testIsDismissibleWithVersions( $savedTime, $currentTime, $expect
*
* @return array<string, array<int|bool>>
*/
public function versionNumbersProvider() {
public static function versionNumbersProvider() {
return array(
'-2weeks' => array( strtotime( '-2weeks' ), time(), true ),
'-4weeks' => array( strtotime( '-4weeks' ), time(), true ),
Expand Down
2 changes: 1 addition & 1 deletion tests/VersionRequirementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function testFromCompareString( $expectation, $component, $compareString
*
* @return array<string, array<string|array<string>>>
*/
public function dataFromCompareString() {
public static function dataFromCompareString() {
return array(
'php > 5.5' => array( array( 'php', '5.5', '>' ), 'php', '>5.5' ),
'php >= 5.5' => array( array( 'php', '5.5', '>=' ), 'php', '>=5.5' ),
Expand Down
2 changes: 1 addition & 1 deletion tests/WPMessageDismissListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function testDismiss( $action, $nonce, $verifyNonceTimes, $isCorrectNonce
*
* @return array<string, array<string, mixed>>
*/
public function listenProvider() {
public static function listenProvider() {
return array(
'correct action and nonce' => array(
'action' => Whip_WPMessageDismissListener::ACTION_NAME,
Expand Down

0 comments on commit 5df8d9d

Please sign in to comment.