Skip to content

Commit

Permalink
Use raw number when testing locales rather than converting to string
Browse files Browse the repository at this point in the history
Caused issues when testing with 7.0.8 and #75
  • Loading branch information
giggsey committed Jul 14, 2015
1 parent 76d55d3 commit d6dbec9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Tests/libphonenumber/Tests/Issues/LocaleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,13 @@ public function testLocales($regionCode, $countryName)
$this->markTestSkipped("{$regionCode} is not supported");
}

$number = $this->phoneUtil->getExampleNumberForType($regionCode, PhoneNumberType::FIXED_LINE_OR_MOBILE);
$phoneNumber = $this->phoneUtil->parse($number, 'ZZ');
$phoneNumber = $this->phoneUtil->getExampleNumberForType($regionCode, PhoneNumberType::FIXED_LINE_OR_MOBILE);

$this->assertContains($regionCode, CountryCodeToRegionCodeMap::$countryCodeToRegionCodeMap[$phoneNumber->getCountryCode()]);

$this->assertEquals($regionCode, $this->phoneUtil->getRegionCodeForNumber($number));
$this->assertEquals($regionCode, $this->phoneUtil->getRegionCodeForNumber($phoneNumber));

$this->assertEquals($countryName, $this->geocoder->getDescriptionForValidNumber($phoneNumber, 'en', 'ZZ'), "Checking {$number} is part of {$countryName}");
$this->assertEquals($countryName, $this->geocoder->getDescriptionForValidNumber($phoneNumber, 'en', 'ZZ'), "Checking {$phoneNumber} is part of {$countryName}");
}

public function localeList()
Expand Down

0 comments on commit d6dbec9

Please sign in to comment.