Skip to content

Commit

Permalink
add unit test row to provider
Browse files Browse the repository at this point in the history
  • Loading branch information
kbosma123 committed Sep 29, 2023
1 parent 18ab980 commit 8050cb2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/Unit/PhoneNumberParseServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,13 @@ public function testParse(
string $nationalNumber,
PhoneNumberTypeEnum $numberType,
string $countryCodeFromObj,
?string $extension = null
?string $extension = null,
?string $overrideCountryCode = null
): void {
$parseService = new PhoneNumberParseService($countryCode);
$result = $parseService->parse($phoneNumber);

$overrideCountryCode ??= $countryCode;
$result = $parseService->parse($phoneNumber, $overrideCountryCode);

static::assertSame($internationalDailCode, $result->getInternationalDialCode());
static::assertSame($countryDialCode, $result->getCountryDialCode());
Expand All @@ -70,6 +73,7 @@ public function testParse(

public function parseProvider(): Generator
{
yield ['BE', '09 34 44 44 32', '00', '33', '934444432', PhoneNumberTypeEnum::VOIP, 'FR', null, 'FR'];
yield ['XX', '+46522180870', '', '46', '522180870', PhoneNumberTypeEnum::FIXED_LINE, 'SE'];
yield ['SE', '+46522180870', '00', '46', '522180870', PhoneNumberTypeEnum::FIXED_LINE, 'SE'];
yield ['SE', '090-230 64 87', '00', '46', '902306487', PhoneNumberTypeEnum::FIXED_LINE, 'SE'];
Expand Down

0 comments on commit 8050cb2

Please sign in to comment.