Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-helldar committed Nov 19, 2023
1 parent 07d07cb commit 375e1f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/Datasets/Locales.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

declare(strict_types=1);

use LaravelLang\Locales\Enums\Locale;
use LaravelLang\LocaleList\Locale;

dataset('locales-string', fn () => Locale::values());
dataset('locales-enum', fn () => Locale::cases());
Expand Down
9 changes: 4 additions & 5 deletions tests/Helpers/assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

declare(strict_types=1);

use LaravelLang\Locales\Enums\Locale;
use LaravelLang\LocaleList\Locale;
use LaravelLang\NativeCountryNames\Enums\SortBy;
use LaravelLang\NativeCountryNames\Helpers\Arr;
use PHPUnit\Framework\Assert;
Expand All @@ -35,12 +35,11 @@
expect()->extend('toBeCompileLocales', function (SortBy $sortBy = SortBy::Value) {
$result = [];

foreach (Locale::values() as $value) {
$result[$value] = sourceLocale($value)[$value];
foreach ($this->value as $key => $value) {
$result[$key] = sourceLocale($key)[$key];
}

$this->toBe(Arr::sortBy($result, $sortBy));

return $this;
}
);
});
2 changes: 1 addition & 1 deletion tests/Unit/EnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

declare(strict_types=1);

use LaravelLang\Locales\Enums\Locale;
use LaravelLang\LocaleList\Locale;
use LaravelLang\NativeCountryNames\Native;

it('checks if the enum matches the locale value', function (Locale $locale) {
Expand Down

0 comments on commit 375e1f2

Please sign in to comment.