Skip to content

Commit

Permalink
Migrate to static data providers using rector/rector
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarStark authored and nicolas-grekas committed Feb 14, 2023
1 parent 4865acf commit af0e32d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Tests/Collator/AbstractCollatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testAsort($array, $sortFlag, $expected)
$this->assertSame($expected, $array);
}

public function asortProvider()
public static function asortProvider()
{
return [
/* array, sortFlag, expected */
Expand Down
10 changes: 5 additions & 5 deletions Tests/CurrenciesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ public function testGetSymbol($displayLocale)
}
}

public function provideCurrencies()
public static function provideCurrencies()
{
return array_map(
function ($currency) { return [$currency]; },
Expand All @@ -701,7 +701,7 @@ public function testGetRoundingIncrement($currency)
$this->assertIsNumeric(Currencies::getRoundingIncrement($currency));
}

public function provideCurrenciesWithNumericEquivalent()
public static function provideCurrenciesWithNumericEquivalent()
{
return array_map(
function ($value) { return [$value]; },
Expand All @@ -717,7 +717,7 @@ public function testGetNumericCode($currency)
$this->assertSame(self::ALPHA3_TO_NUMERIC[$currency], Currencies::getNumericCode($currency));
}

public function provideCurrenciesWithoutNumericEquivalent()
public static function provideCurrenciesWithoutNumericEquivalent()
{
return array_map(
function ($value) { return [$value]; },
Expand All @@ -734,7 +734,7 @@ public function testGetNumericCodeFailsIfNoNumericEquivalent($currency)
Currencies::getNumericCode($currency);
}

public function provideValidNumericCodes()
public static function provideValidNumericCodes()
{
$numericToAlpha3 = $this->getNumericToAlpha3Mapping();

Expand All @@ -759,7 +759,7 @@ public function testForNumericCode($numeric, $expected)
$this->assertSame($expected, $actual);
}

public function provideInvalidNumericCodes()
public static function provideInvalidNumericCodes()
{
$validNumericCodes = array_keys($this->getNumericToAlpha3Mapping());
$invalidNumericCodes = array_diff(range(0, 1000), $validNumericCodes);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Data/Bundle/Reader/BundleEntryReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function testDontFallbackIfLocaleDoesNotExistAndFallbackDisabled()
$this->reader->readEntry(self::RES_DIR, 'en_GB', ['Entries', 'Bam'], false);
}

public function provideMergeableValues()
public static function provideMergeableValues()
{
return [
['foo', null, 'foo'],
Expand Down
2 changes: 1 addition & 1 deletion Tests/Globals/AbstractIntlGlobalsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
abstract class AbstractIntlGlobalsTest extends TestCase
{
public function errorNameProvider()
public static function errorNameProvider()
{
return [
[-129, '[BOGUS UErrorCode]'],
Expand Down
8 changes: 4 additions & 4 deletions Tests/LanguagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ public function testGetNameDefaultLocale()
}
}

public function provideLanguagesWithAlpha3Equivalent()
public static function provideLanguagesWithAlpha3Equivalent()
{
return array_map(
function ($value) { return [$value]; },
Expand All @@ -1758,7 +1758,7 @@ public function testGetAlpha3Code($language)
$this->assertSame(self::ALPHA2_TO_ALPHA3[$language], Languages::getAlpha3Code($language));
}

public function provideLanguagesWithoutAlpha3Equivalent()
public static function provideLanguagesWithoutAlpha3Equivalent()
{
return array_map(
function ($value) { return [$value]; },
Expand Down Expand Up @@ -1792,7 +1792,7 @@ public function testGetAlpha3Codes()
$this->assertSame(self::ALPHA3_CODES, Languages::getAlpha3Codes());
}

public function provideLanguagesWithAlpha2Equivalent()
public static function provideLanguagesWithAlpha2Equivalent()
{
return array_map(
function ($value) { return [$value]; },
Expand All @@ -1808,7 +1808,7 @@ public function testGetAlpha2Code($language)
$this->assertSame(self::ALPHA3_TO_ALPHA2[$language], Languages::getAlpha2Code($language));
}

public function provideLanguagesWithoutAlpha2Equivalent()
public static function provideLanguagesWithoutAlpha2Equivalent()
{
return array_map(
function ($value) { return [$value]; },
Expand Down
2 changes: 1 addition & 1 deletion Tests/LocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class LocaleTest extends TestCase
{
public function provideGetFallbackTests()
public static function provideGetFallbackTests()
{
$tests = [
['sl_Latn_IT', 'sl_Latn_IT_nedis'],
Expand Down
4 changes: 2 additions & 2 deletions Tests/TimezonesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ public function testGetCountryCodeAvailability(string $timezone)
}
}

public function provideTimezones(): iterable
public static function provideTimezones(): iterable
{
return array_map(function ($timezone) {
return [$timezone];
Expand All @@ -657,7 +657,7 @@ public function testForCountryCodeAvailability(string $country)
$this->addToAssertionCount(1);
}

public function provideCountries(): iterable
public static function provideCountries(): iterable
{
return array_map(function ($country) {
return [$country];
Expand Down
4 changes: 2 additions & 2 deletions Tests/Util/IcuVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class IcuVersionTest extends TestCase
{
public function normalizeProvider()
public static function normalizeProvider()
{
return [
[null, '1', '10'],
Expand Down Expand Up @@ -49,7 +49,7 @@ public function testNormalize($precision, $version, $result)
$this->assertSame($result, IcuVersion::normalize($version, $precision));
}

public function compareProvider()
public static function compareProvider()
{
return [
[null, '1', '==', '1', true],
Expand Down
4 changes: 2 additions & 2 deletions Tests/Util/VersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class VersionTest extends TestCase
{
public function normalizeProvider()
public static function normalizeProvider()
{
return [
[null, '1', '1'],
Expand Down Expand Up @@ -53,7 +53,7 @@ public function testNormalize($precision, $version, $result)
$this->assertSame($result, Version::normalize($version, $precision));
}

public function compareProvider()
public static function compareProvider()
{
return [
[null, '1', '==', '1', true],
Expand Down

0 comments on commit af0e32d

Please sign in to comment.