Skip to content

Commit 1142c60

Browse files
jrfnlgrogy
authored andcommitted
Tests: make dataproviders static
As of PHPUnit 10, data providers are (again) expected to be `static` methods. This updates the test suite to respect that. Includes removing the use of `$this` from select data providers. Refs: * sebastianbergmann/phpunit@9caafe2 * sebastianbergmann/phpunit 5100
1 parent fe1ecbe commit 1142c60

7 files changed

+10
-10
lines changed

tests/Unit/Errors/ParallelLintErrorTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testGetMessage($message, $expected)
3131
*
3232
* @return array
3333
*/
34-
public function dataGetMessage()
34+
public static function dataGetMessage()
3535
{
3636
return array(
3737
'Message: empty string' => array(
@@ -88,7 +88,7 @@ public function testGetShortFilePath($filePath, $expectedShort)
8888
*
8989
* @return array
9090
*/
91-
public function dataGetFilePath()
91+
public static function dataGetFilePath()
9292
{
9393
$cwd = getcwd();
9494

tests/Unit/Errors/SyntaxErrorGetLineTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testGetLine($message, $expected)
3131
*
3232
* @return array
3333
*/
34-
public function dataGetLine()
34+
public static function dataGetLine()
3535
{
3636
return array(
3737
'Message: empty string' => array(

tests/Unit/Errors/SyntaxErrorGetNormalizeMessageTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testMessageNormalizationWithoutTokenTranslation($message, $expec
3131
*
3232
* @return array
3333
*/
34-
public function dataMessageNormalization()
34+
public static function dataMessageNormalization()
3535
{
3636
return array(
3737
'Strip leading and trailing information - fatal error' => array(
@@ -85,7 +85,7 @@ public function testFilePathHandling($filePath, $fileName)
8585
*
8686
* @return array
8787
*/
88-
public function dataFilePathHandling()
88+
public static function dataFilePathHandling()
8989
{
9090
return array(
9191
'Plain file name' => array(

tests/Unit/Errors/SyntaxErrorTranslateTokensTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testTranslateTokens($message, $expected)
3131
*
3232
* @return array
3333
*/
34-
public function dataTranslateTokens()
34+
public static function dataTranslateTokens()
3535
{
3636
return array(
3737
'No token name in message' => array(

tests/Unit/Outputs/OutputTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function testCheckstyleOutput()
6868
$this->assertInstanceOf('SimpleXMLElement', $parsed);
6969
}
7070

71-
public function getGitLabOutputData()
71+
public static function getGitLabOutputData()
7272
{
7373
return array(
7474
array(

tests/Unit/SettingsAddPathsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testAddPaths($original, $extra, $expected)
3636
*
3737
* @return array
3838
*/
39-
public function dataAddPaths()
39+
public static function dataAddPaths()
4040
{
4141
return array(
4242
'No paths passed on CLI, no extra paths' => array(

tests/Unit/SettingsParseArgumentsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testParseArgumentsInvalidArgument($command, $unsupported)
3535
*
3636
* @return array
3737
*/
38-
public function dataParseArgumentsInvalidArgument()
38+
public static function dataParseArgumentsInvalidArgument()
3939
{
4040
return array(
4141
'Unsupported short argument' => array(
@@ -79,7 +79,7 @@ public function testParseArguments($command, array $expectedChanged)
7979
*
8080
* @return array
8181
*/
82-
public function dataParseArguments()
82+
public static function dataParseArguments()
8383
{
8484
return array(
8585
'No arguments at all' => array(

0 commit comments

Comments
 (0)