diff --git a/tests/Unit/PhoneNumberParseServiceTest.php b/tests/Unit/PhoneNumberParseServiceTest.php index 49d7b99..24cc60f 100644 --- a/tests/Unit/PhoneNumberParseServiceTest.php +++ b/tests/Unit/PhoneNumberParseServiceTest.php @@ -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()); @@ -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'];