mirror of
https://github.com/archtechx/enums.git
synced 2025-12-12 12:54:04 +00:00
feat: Add support for default values on metadata properties (#23)
refactor: Remove comment
This commit is contained in:
parent
a99ee1a7e0
commit
5be8a58974
4 changed files with 45 additions and 2 deletions
|
|
@ -60,4 +60,12 @@ test('fromMeta throws an exception when the enum cannot be instantiated', functi
|
|||
|
||||
test('tryFromMeta silently fails when the enum cannot be instantiated')
|
||||
->expect(Role::tryFromMeta(Color::make('foobar')))
|
||||
->toBe(null);
|
||||
->toBeNull();
|
||||
|
||||
test('metadata properties return null if missing on the case')
|
||||
->expect(RoleWithoutAttribute::ADMIN->desc())
|
||||
->toBeNull();
|
||||
|
||||
test('metadata can have default values')
|
||||
->expect(ReferenceType::INACTIVE_TYPE->isActive())
|
||||
->toBeFalse();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue