Skip to content

Commit

Permalink
Merge pull request #9 from seisigmasrl/feature/rnc-type
Browse files Browse the repository at this point in the history
Improving the Package Toolset
  • Loading branch information
ricardov03 authored Feb 7, 2023
2 parents b9c8d75 + 4955ea5 commit 49b2d50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
13 changes: 2 additions & 11 deletions src/helpers/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,8 @@ public function toString(): string
{
return match ($this) {
self::RNC => 'RNC',
self::CEDULA => 'Cédula',
self::PASSPORT => 'Pasaporte',
};
}

public function fromString(string $string): self
{
return match ($string) {
'RNC' => self::RNC,
'Cédula' => self::CEDULA,
'Pasaporte' => self::PASSPORT,
self::CEDULA => 'CEDULA',
self::PASSPORT => 'PASSPORT',
};
}
}
2 changes: 1 addition & 1 deletion tests/DgiiRncValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

test('check rncType return the type name', function () {
expect(DgiiRncValidator::rncType('123456789'))->toBe('RNC')
->and(DgiiRncValidator::rncType('12345678901'))->toBe('Cédula');
->and(DgiiRncValidator::rncType('12345678901'))->toBe('CEDULA');
});

it('can return the details of an RNC if true', function () {
Expand Down

0 comments on commit 49b2d50

Please sign in to comment.