Skip to content

Commit 0bd68a9

Browse files
committed
replace assertEmpty() with stricter assertions
1 parent 76bb346 commit 0bd68a9

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Tests/LanguagesTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,7 @@ public function testGetNames($displayLocale)
17251725
sort($languages);
17261726

17271727
$this->assertNotEmpty($languages);
1728-
$this->assertEmpty(array_diff($languages, self::LANGUAGES));
1728+
$this->assertSame([], array_diff($languages, self::LANGUAGES));
17291729

17301730
foreach (Languages::getAlpha3Names($displayLocale) as $alpha3Code => $name) {
17311731
$alpha2Code = self::ALPHA3_TO_ALPHA2[$alpha3Code] ?? null;
@@ -1928,7 +1928,7 @@ public function testGetAlpha3Names($displayLocale)
19281928
sort($languages);
19291929

19301930
$this->assertNotEmpty($languages);
1931-
$this->assertEmpty(array_diff($languages, self::ALPHA3_CODES));
1931+
$this->assertSame([], array_diff($languages, self::ALPHA3_CODES));
19321932

19331933
foreach (Languages::getNames($displayLocale) as $alpha2Code => $name) {
19341934
$alpha3Code = self::ALPHA2_TO_ALPHA3[$alpha2Code] ?? (3 === \strlen($alpha2Code) ? $alpha2Code : null);

Tests/LocalesTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testGetNames($displayLocale)
4646
// We can't assert on exact list of locale, as there's too many variations.
4747
// The best we can do is to make sure getNames() returns a subset of what getLocales() returns.
4848
$this->assertNotEmpty($locales);
49-
$this->assertEmpty(array_diff($locales, static::getLocales()));
49+
$this->assertSame([], array_diff($locales, static::getLocales()));
5050
}
5151

5252
public function testGetNamesDefaultLocale()

Tests/ScriptsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public function testGetNames($displayLocale)
254254
// We can't assert on exact list of scripts, as there's too many variations between locales.
255255
// The best we can do is to make sure getNames() returns a subset of what getScripts() returns.
256256
$this->assertNotEmpty($scripts);
257-
$this->assertEmpty(array_diff($scripts, self::$scripts));
257+
$this->assertSame([], array_diff($scripts, self::$scripts));
258258
}
259259

260260
public function testGetNamesDefaultLocale()

Tests/TimezonesTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public function testGetNames($displayLocale)
473473
sort($zones);
474474

475475
$this->assertNotEmpty($zones);
476-
$this->assertEmpty(array_diff($zones, self::ZONES));
476+
$this->assertSame([], array_diff($zones, self::ZONES));
477477
}
478478

479479
public function testGetNamesDefaultLocale()

0 commit comments

Comments
 (0)