Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
trippo authored and github-actions[bot] committed Jun 14, 2022
1 parent 8322e24 commit db53a99
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/EnumNamesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
]);

it('throw an EmptyCases exception calling names method with empty cases', function ($enumClass, $cases) {
expect(fn() => $enumClass::names($cases))->toThrow(EmptyCases::class, "The enum $enumClass has empty case or you pass empty array as parameter");
expect(fn () => $enumClass::names($cases))->toThrow(EmptyCases::class, "The enum $enumClass has empty case or you pass empty array as parameter");
})->with('emptyCases');

it('can return an associative array of names', function ($enumClass, $result) {
Expand All @@ -50,7 +50,7 @@
]);

it('throw an NotBackedEnum exception with pure enum calling namesByValue method', function ($enumClass) {
expect(fn() => $enumClass::namesByValue())->toThrow(NotBackedEnum::class, "$enumClass is not a BackedEnum");
expect(fn () => $enumClass::namesByValue())->toThrow(NotBackedEnum::class, "$enumClass is not a BackedEnum");
})->with([
[Status::class],
[StatusPascalCase::class],
Expand Down Expand Up @@ -103,10 +103,10 @@
})->with([
'Pure enum' => [Status::class, [Status::NO_RESPONSE, Status::DISCARDED], [
'NO_RESPONSE' => 'NO_RESPONSE',
'DISCARDED' => 'DISCARDED',]],
'DISCARDED' => 'DISCARDED', ]],
'PascalCase Pure enum' => [StatusPascalCase::class, [StatusPascalCase::Accepted, StatusPascalCase::Discarded], [
'Accepted' => 'Accepted',
'Discarded' => 'Discarded',]],
'Discarded' => 'Discarded', ]],
'String Backed enum' => [StatusString::class, [StatusString::NO_RESPONSE, StatusString::DISCARDED], [
'N' => 'NO_RESPONSE',
'D' => 'DISCARDED',
Expand All @@ -118,16 +118,16 @@
]);

it('throw an NotBackedEnum exception with pure enum calling namesByValue method with param', function ($enumClass, $cases) {
expect(fn() => $enumClass::namesByValue($cases))->toThrow(NotBackedEnum::class, "$enumClass is not a BackedEnum");
expect(fn () => $enumClass::namesByValue($cases))->toThrow(NotBackedEnum::class, "$enumClass is not a BackedEnum");
})->with('notBackedEnum');

it('throw an EmptyCases exception calling namesByValue method with empty cases', function ($enumClass, $cases) {
expect(fn() => $enumClass::namesByValue($cases))->toThrow(EmptyCases::class, "The enum $enumClass has empty case or you pass empty array as parameter");
expect(fn () => $enumClass::namesByValue($cases))->toThrow(EmptyCases::class, "The enum $enumClass has empty case or you pass empty array as parameter");
})->with([
'backed enum' => [StatusString::class, []],
'empty cases enum' => [EmptyClass::class, null],
]);

it('throw an EmptyCases exception calling namesAsSelect method with empty cases', function ($enumClass, $cases) {
expect(fn() => $enumClass::namesAsSelect($cases))->toThrow(EmptyCases::class, "The enum $enumClass has empty case or you pass empty array as parameter");
expect(fn () => $enumClass::namesAsSelect($cases))->toThrow(EmptyCases::class, "The enum $enumClass has empty case or you pass empty array as parameter");
})->with('emptyCases');

0 comments on commit db53a99

Please sign in to comment.