Skip to content

Commit 472549d

Browse files
committed
[Intl][Tests] Use static data providers
1 parent a2bf3df commit 472549d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Tests/ResourceBundleTestCase.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -758,46 +758,46 @@ protected function tearDown(): void
758758
\Locale::setDefault($this->defaultLocale);
759759
}
760760

761-
public function provideLocales()
761+
public static function provideLocales()
762762
{
763763
return array_map(
764764
fn ($locale) => [$locale],
765-
$this->getLocales()
765+
self::getLocales()
766766
);
767767
}
768768

769-
public function provideLocaleAliases()
769+
public static function provideLocaleAliases()
770770
{
771771
return array_map(
772772
fn ($alias, $ofLocale) => [$alias, $ofLocale],
773-
array_keys($this->getLocaleAliases()),
774-
$this->getLocaleAliases()
773+
array_keys(self::getLocaleAliases()),
774+
self::getLocaleAliases()
775775
);
776776
}
777777

778-
public function provideRootLocales()
778+
public static function provideRootLocales()
779779
{
780780
return array_map(
781781
fn ($locale) => [$locale],
782-
$this->getRootLocales()
782+
self::getRootLocales()
783783
);
784784
}
785785

786-
protected function getLocales()
786+
protected static function getLocales()
787787
{
788788
return self::LOCALES;
789789
}
790790

791-
protected function getLocaleAliases()
791+
protected static function getLocaleAliases()
792792
{
793793
return self::LOCALE_ALIASES;
794794
}
795795

796-
protected function getRootLocales()
796+
protected static function getRootLocales()
797797
{
798798
if (null === self::$rootLocales) {
799-
self::$rootLocales = array_filter($this->getLocales(), fn ($locale) => // no locales for which fallback is possible (e.g "en_GB")
800-
!str_contains($locale, '_'));
799+
// ignore locales for which fallback is possible (e.g "en_GB")
800+
self::$rootLocales = array_filter(self::getLocales(), fn ($locale) => !str_contains($locale, '_'));
801801
}
802802

803803
return self::$rootLocales;

0 commit comments

Comments
 (0)