Skip to content

Commit

Permalink
Mark all data providers as static
Browse files Browse the repository at this point in the history
Static data providers are deprecated in PHPUnit 10
  • Loading branch information
Aad Mathijssen authored and Seldaek committed Aug 21, 2024
1 parent ea5eed3 commit 9040637
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
14 changes: 7 additions & 7 deletions tests/ComparatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function testCompare($version1, $operator, $version2, $expected)
/**
* @return array<mixed>
*/
public function greaterThanProvider()
public static function greaterThanProvider()
{
return array(
array('1.25.0', '1.24.0', true),
Expand All @@ -143,7 +143,7 @@ public function greaterThanProvider()
/**
* @return array<mixed>
*/
public function greaterThanOrEqualToProvider()
public static function greaterThanOrEqualToProvider()
{
return array(
array('1.25.0', '1.24.0', true),
Expand All @@ -155,7 +155,7 @@ public function greaterThanOrEqualToProvider()
/**
* @return array<mixed>
*/
public function lessThanProvider()
public static function lessThanProvider()
{
return array(
array('1.25.0', '1.24.0', false),
Expand All @@ -171,7 +171,7 @@ public function lessThanProvider()
/**
* @return array<mixed>
*/
public function lessThanOrEqualToProvider()
public static function lessThanOrEqualToProvider()
{
return array(
array('1.25.0', '1.24.0', false),
Expand All @@ -183,7 +183,7 @@ public function lessThanOrEqualToProvider()
/**
* @return array<mixed>
*/
public function equalToProvider()
public static function equalToProvider()
{
return array(
array('1.25.0', '1.24.0', false),
Expand All @@ -198,7 +198,7 @@ public function equalToProvider()
/**
* @return array<mixed>
*/
public function notEqualToProvider()
public static function notEqualToProvider()
{
return array(
array('1.25.0', '1.24.0', true),
Expand All @@ -210,7 +210,7 @@ public function notEqualToProvider()
/**
* @return array<mixed>
*/
public function compareProvider()
public static function compareProvider()
{
return array(
array('1.25.0', '>', '1.24.0', true),
Expand Down
6 changes: 3 additions & 3 deletions tests/Constraint/ConstraintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public function testInvalidOperators($version, $operator, $expected)
/**
* @return array<mixed>
*/
public function invalidOperators()
public static function invalidOperators()
{
return array(
array('1.2.3', 'invalid', 'InvalidArgumentException'),
Expand Down Expand Up @@ -470,7 +470,7 @@ public function testBounds($operator, $normalizedVersion, Bound $expectedLower,
/**
* @return array<mixed>
*/
public function bounds()
public static function bounds()
{
return array(
'equal to 1.0.0.0' => array('==', '1.0.0.0', new Bound('1.0.0.0', true), new Bound('1.0.0.0', true)),
Expand Down Expand Up @@ -539,7 +539,7 @@ public function testCompile($requireOperator, $requireVersion, $provideOperator,
/**
* @return array<mixed>
*/
public function matrix()
public static function matrix()
{
$versions = array('1.0', '2.0', 'dev-master', 'dev-foo', '3.0-b2', '3.0-beta2');
$operators = array('==', '!=', '>', '<', '>=', '<=');
Expand Down
6 changes: 3 additions & 3 deletions tests/Constraint/MultiConstraintTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function testBounds(array $constraints, $conjunctive, Bound $expectedLowe
/**
* @return array<mixed>
*/
public function bounds()
public static function bounds()
{
return array(
'all equal' => array(
Expand Down Expand Up @@ -230,7 +230,7 @@ public function testBoundsIntegrationWithVersionParser($constraints, Bound $expe
/**
* @return array<mixed>
*/
public function boundsIntegration()
public static function boundsIntegration()
{
return array(
'^7.0' => array(
Expand Down Expand Up @@ -325,7 +325,7 @@ public function testMultiConstraintOptimizations($constraints, ConstraintInterfa
/**
* @return array<mixed>
*/
public function multiConstraintOptimizations()
public static function multiConstraintOptimizations()
{
return array(
'Test collapses contiguous' => array(
Expand Down
4 changes: 2 additions & 2 deletions tests/IntervalsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testCompactConstraint($expected, $toCompact, $conjunctive)
$this->assertSame((string) $expected, (string) $new);
}

public function compactProvider()
public static function compactProvider()
{
return array(
'simple disjunctive multi' => array(
Expand Down Expand Up @@ -238,7 +238,7 @@ public function testGetIntervals($expected, $constraint)
$this->assertSame($expected, $result);
}

public function intervalsProvider()
public static function intervalsProvider()
{
return array(
'simple case' => array(
Expand Down
14 changes: 7 additions & 7 deletions tests/SemverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function testUsortShouldInitialVersionParserClass()
/**
* @return array<mixed>
*/
public function sortProvider()
public static function sortProvider()
{
return array(
array(
Expand All @@ -98,27 +98,27 @@ public function sortProvider()
/**
* @return array<mixed>
*/
public function satisfiesProvider()
public static function satisfiesProvider()
{
$positive = array_map(function ($array) {
array_unshift($array, true);

return $array;
}, $this->satisfiesProviderPositive());
}, static::satisfiesProviderPositive());

$negative = array_map(function ($array) {
array_unshift($array, false);

return $array;
}, $this->satisfiesProviderNegative());
}, static::satisfiesProviderNegative());

return array_merge($positive, $negative);
}

/**
* @return array<mixed>
*/
public function satisfiesProviderPositive()
public static function satisfiesProviderPositive()
{
return array(
array('1.2.3', '1.0.0 - 2.0.0'),
Expand Down Expand Up @@ -200,7 +200,7 @@ public function satisfiesProviderPositive()
/**
* @return array<mixed>
*/
public function satisfiesProviderNegative()
public static function satisfiesProviderNegative()
{
return array(
array('2.2.3', '1.0.0 - 2.0.0'),
Expand Down Expand Up @@ -254,7 +254,7 @@ public function satisfiesProviderNegative()
/**
* @return array<mixed>
*/
public function satisfiedByProvider()
public static function satisfiedByProvider()
{
return array(
array(
Expand Down
4 changes: 2 additions & 2 deletions tests/SubsetsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testIsSubsetOf($aStr, $bStr)
/**
* @return array<mixed>
*/
public function subsets()
public static function subsets()
{
return array(
// x is subset of y
Expand Down Expand Up @@ -101,7 +101,7 @@ public function testIsNotSubsetOf($aStr, $bStr)
/**
* @return array<mixed>
*/
public function notSubsets()
public static function notSubsets()
{
return array(
// x is subset of y
Expand Down
32 changes: 16 additions & 16 deletions tests/VersionParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testParseNumericAliasPrefix($input, $expected)
/**
* @return array<mixed>
*/
public function numericAliasVersions()
public static function numericAliasVersions()
{
return array(
array('0.x-dev', '0.'),
Expand Down Expand Up @@ -62,7 +62,7 @@ public function testNormalizeSucceeds($input, $expected)
/**
* @return array<mixed>
*/
public function successfulNormalizedVersions()
public static function successfulNormalizedVersions()
{
return array(
'none' => array('1.0.0', '1.0.0.0'),
Expand Down Expand Up @@ -157,7 +157,7 @@ public function testNormalizeFails($input)
/**
* @return array<mixed>
*/
public function failingNormalizedVersions()
public static function failingNormalizedVersions()
{
return array(
'empty ' => array(''),
Expand Down Expand Up @@ -208,7 +208,7 @@ public function testNormalizeFailsAndReportsAliasIssue($fullInput)
/**
* @return array<mixed>
*/
public function failingNormalizedVersionsWithBadAlias()
public static function failingNormalizedVersionsWithBadAlias()
{
return array(
'Alias and caret' => array('1.0.0+foo as ^2.0'),
Expand Down Expand Up @@ -238,7 +238,7 @@ public function testNormalizeFailsAndReportsAliaseeIssue($fullInput)
/**
* @return array<mixed>
*/
public function failingNormalizedVersionsWithBadAliasee()
public static function failingNormalizedVersionsWithBadAliasee()
{
return array(
'Alias and caret' => array('^2.0 as 1.0.0+foo'),
Expand All @@ -264,7 +264,7 @@ public function testNormalizeBranch($input, $expected)
/**
* @return array<mixed>
*/
public function successfulNormalizedBranches()
public static function successfulNormalizedBranches()
{
return array(
'parses x' => array('v1.x', '1.9999999.9999999.9999999-dev'),
Expand Down Expand Up @@ -333,7 +333,7 @@ public function testParseConstraintsSimple($input, $expected)
/**
* @return array<mixed>
*/
public function simpleConstraints()
public static function simpleConstraints()
{
return array(
'match any' => array('*', new MatchAllConstraint()),
Expand Down Expand Up @@ -392,7 +392,7 @@ public function testParseConstraintsWildcard($input, $min, $max)
/**
* @return array<mixed>
*/
public function wildcardConstraints()
public static function wildcardConstraints()
{
return array(
array('v2.*', new Constraint('>=', '2.0.0.0-dev'), new Constraint('<', '3.0.0.0-dev')),
Expand Down Expand Up @@ -434,7 +434,7 @@ public function testParseTildeWildcard($input, $min, $max)
/**
* @return array<mixed>
*/
public function tildeConstraints()
public static function tildeConstraints()
{
return array(
array('~v1', new Constraint('>=', '1.0.0.0-dev'), new Constraint('<', '2.0.0.0-dev')),
Expand Down Expand Up @@ -481,7 +481,7 @@ public function testParseCaretWildcard($input, $min, $max)
/**
* @return array<mixed>
*/
public function caretConstraints()
public static function caretConstraints()
{
return array(
array('^v1', new Constraint('>=', '1.0.0.0-dev'), new Constraint('<', '2.0.0.0-dev')),
Expand Down Expand Up @@ -531,7 +531,7 @@ public function testParseHyphen($input, $min, $max)
/**
* @return array<mixed>
*/
public function hyphenConstraints()
public static function hyphenConstraints()
{
return array(
array('v1 - v2', new Constraint('>=', '1.0.0.0-dev'), new Constraint('<', '3.0.0.0-dev')),
Expand Down Expand Up @@ -566,7 +566,7 @@ public function testParseConstraints($constraint, $expected)
/**
* @return array<mixed>
*/
public function constraintProvider()
public static function constraintProvider()
{
return array(
// numeric branch
Expand Down Expand Up @@ -618,7 +618,7 @@ public function testParseConstraintsMulti($constraint)
/**
* @return array<mixed>
*/
public function multiConstraintProvider()
public static function multiConstraintProvider()
{
return array(
array('>2.0,<=3.0'),
Expand Down Expand Up @@ -670,7 +670,7 @@ public function testParseConstraintsMultiDisjunctiveHasPrioOverConjuctive($const
/**
* @return array<mixed>
*/
public function multiConstraintProvider2()
public static function multiConstraintProvider2()
{
return array(
array('>2.0,<2.0.5 | >2.0.6'),
Expand Down Expand Up @@ -724,7 +724,7 @@ public function testParseConstraintsFails($input)
/**
* @return array<mixed>
*/
public function failingConstraints()
public static function failingConstraints()
{
return array(
'empty ' => array(''),
Expand Down Expand Up @@ -783,7 +783,7 @@ public function testParseStability($expected, $version)
/**
* @return array<mixed>
*/
public function stabilityProvider()
public static function stabilityProvider()
{
return array(
array('stable', '1'),
Expand Down

0 comments on commit 9040637

Please sign in to comment.