Skip to content

Commit 87896d6

Browse files
committed
Tests: as of PHPUnit 10 data provider methods should be static
Per the PHPUnit manual: "A data provider method must be public and static" (https://docs.phpunit.de/en/12.0/writing-tests-for-phpunit.html). A similar change was done in the PHPCS repository: PHPCSStandards/PHP_CodeSniffer#255 Tests will continue to work when running with PHPUnit < 10.
1 parent 2980fb3 commit 87896d6

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

Tests/DocsXsd/DocsXsdTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testXsdValidationPassedWithValidXml($fixtureFile)
6060
*
6161
* @return array
6262
*/
63-
public function dataValidXsd()
63+
public static function dataValidXsd()
6464
{
6565
return [
6666
'Valid docs example with single standard in the file' => [
@@ -110,7 +110,7 @@ public function testXsdValidationFailsForInvalidXml($fixtureFile, $expectedStdOu
110110
*
111111
* @return array
112112
*/
113-
public function dataInvalidXsd()
113+
public static function dataInvalidXsd()
114114
{
115115
return [
116116
'Title attribute too long on <documentation> element' => [

Tests/FeatureComplete/Check/ColorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testColors($fixtureDir, $expectedOutput, $exitCode, $src = 'stdo
6565
*
6666
* @return array
6767
*/
68-
public function dataColors()
68+
public static function dataColors()
6969
{
7070
return [
7171
'feature complete - header' => [

Tests/FeatureComplete/Check/MarkProgressTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function testProgress($nrOfFiles, $expectedOutput)
104104
*
105105
* @return array
106106
*/
107-
public function dataProgress()
107+
public static function dataProgress()
108108
{
109109
return [
110110
'single line progress reporting (<= 60 sniffs)' => [

Tests/FeatureComplete/Check/NoSniffsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function testTargetDoesntContainSniffs($fixtureDir)
7777
*
7878
* @return array
7979
*/
80-
public function dataTargetDoesntContainSniffs()
80+
public static function dataTargetDoesntContainSniffs()
8181
{
8282
return [
8383
'empty directory' => ['EmptyDir'],

Tests/FeatureComplete/Check/ValidStandardsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testFeatureCompleteStandard($fixtureDir, $testDocCount)
6363
*
6464
* @return array
6565
*/
66-
public function dataFeatureCompleteStandard()
66+
public static function dataFeatureCompleteStandard()
6767
{
6868
return [
6969
'feature complete with CSS test files' => [

Tests/FeatureComplete/Config/GetHelpTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function testShowHelpNoColors($command)
107107
*
108108
* @return array
109109
*/
110-
public function dataShowHelp()
110+
public static function dataShowHelp()
111111
{
112112
return [
113113
'-h' => [

Tests/FeatureComplete/Config/GetVersionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testShowVersion($command)
4949
*
5050
* @return array
5151
*/
52-
public function dataShowVersion()
52+
public static function dataShowVersion()
5353
{
5454
return [
5555
'-V' => [

Tests/FeatureComplete/Config/MagicMethodsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testGet($propertyName, $expected)
6565
*
6666
* @return void
6767
*/
68-
public function dataGet()
68+
public static function dataGet()
6969
{
7070
return [
7171
'property which doesn\'t exist on the class' => [
@@ -104,7 +104,7 @@ public function testIsset($propertyName, $expected)
104104
*
105105
* @return void
106106
*/
107-
public function dataIsset()
107+
public static function dataIsset()
108108
{
109109
return [
110110
'property which doesn\'t exist on the class' => [
@@ -167,7 +167,7 @@ public function testUnset($propertyName)
167167
*
168168
* @return void
169169
*/
170-
public function dataSetUnset()
170+
public static function dataSetUnset()
171171
{
172172
return [
173173
'property which doesn\'t exist on the class' => ['doesnotexist'],

Tests/FeatureComplete/Config/ProcessCliCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testProcessCliCommandUnsupportedArgument($command)
7373
*
7474
* @return array
7575
*/
76-
public function dataProcessCliCommandUnsupportedArgument()
76+
public static function dataProcessCliCommandUnsupportedArgument()
7777
{
7878
return [
7979
'Unsupported short arguments' => [
@@ -141,7 +141,7 @@ public function testProcessCliCommand($command, array $expectedChanged, $checkSh
141141
*
142142
* @return array
143143
*/
144-
public function dataProcessCliCommand()
144+
public static function dataProcessCliCommand()
145145
{
146146
/*
147147
* For project root, we only really verify that it has been set as the value will depend
@@ -402,7 +402,7 @@ public function testProcessCliCommandOutputOnlyArgs($command, $expectedChanged)
402402
*
403403
* @return array
404404
*/
405-
public function dataProcessCliCommandOutputOnlyArgs()
405+
public static function dataProcessCliCommandOutputOnlyArgs()
406406
{
407407
/*
408408
* For project root, we only verify that it has been set as the value will depend on the

0 commit comments

Comments
 (0)