Upgrade tests to PhpUnit 10 (#5252)

This commit is contained in:
Kevin Papst
2024-12-22 01:25:30 +01:00
committed by GitHub
parent 9bd37fb695
commit c7f0508707
377 changed files with 3308 additions and 3409 deletions

View File

@@ -106,10 +106,10 @@ class LocaleServiceTest extends TestCase
public function testGetAllLocales(): void
{
$sut = $this->getSut([]);
$this->assertEquals([], $sut->getAllLocales());
self::assertEquals([], $sut->getAllLocales());
$sut = $this->getSut($this->getDefaultSettings());
$this->assertEquals(['de', 'en', 'en_AU', 'pt_BR', 'it', 'fr', 'fr_BE', 'fr_CA', 'es', 'ru', 'ar', 'hu'], $sut->getAllLocales());
self::assertEquals(['de', 'en', 'en_AU', 'pt_BR', 'it', 'fr', 'fr_BE', 'fr_CA', 'es', 'ru', 'ar', 'hu'], $sut->getAllLocales());
}
public function testInvalidLocaleWithGivenLocale(): void
@@ -124,26 +124,26 @@ class LocaleServiceTest extends TestCase
public function testGetDurationFormat(): void
{
$sut = $this->getSut($this->getDefaultSettings());
$this->assertEquals('%h:%m', $sut->getDurationFormat('de'));
self::assertEquals('%h:%m', $sut->getDurationFormat('de'));
}
public function testGetDateFormat(): void
{
$sut = $this->getSut($this->getDefaultSettings());
$this->assertEquals('d.m.Y', $sut->getDateFormat('de'));
self::assertEquals('d.m.Y', $sut->getDateFormat('de'));
}
public function testGetDateTimeFormat(): void
{
$sut = $this->getSut($this->getDefaultSettings());
$this->assertEquals('d.m.Y H:i', $sut->getDateTimeFormat('de'));
self::assertEquals('d.m.Y H:i', $sut->getDateTimeFormat('de'));
}
public function testGetTimeFormat(): void
{
$sut = $this->getSut($this->getDefaultSettings());
$this->assertEquals('H:i', $sut->getTimeFormat('de'));
$this->assertEquals('H:i:s', $sut->getTimeFormat('en'));
self::assertEquals('H:i', $sut->getTimeFormat('de'));
self::assertEquals('H:i:s', $sut->getTimeFormat('en'));
}
/**
@@ -153,13 +153,13 @@ class LocaleServiceTest extends TestCase
{
$sut = $this->getSut($this->getDefaultSettings());
$actual = $sut->getNearestTranslationLocale($locale);
$this->assertEquals($expected, $actual);
self::assertEquals($expected, $actual);
}
/**
* @return array<int, array<int, string>>
*/
public function getNearestTranslationLocaleData(): array
public static function getNearestTranslationLocaleData(): array
{
return [
['de', 'de'], // registered and translated: use it