Permalink
Browse files

Added testGetRegionCodeForNumber test

  • Loading branch information...
1 parent cf8d581 commit b0a589fa701e6adc4863337192789e39ece12d3b @davideme committed May 3, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 Tests/PhoneNumberUtilTest.php
@@ -654,6 +654,13 @@ public function testIsValidNumberForRegion() {
$this->assertFalse($this->phoneUtil->isValidNumberForRegion($invalidNumber, RegionCode::ZZ));
}
+ public function testGetRegionCodeForNumber() {
+ $this->assertEquals(RegionCode::BS, $this->phoneUtil->getRegionCodeForNumber(self::$bsNumber));
+ $this->assertEquals(RegionCode::US, $this->phoneUtil->getRegionCodeForNumber(self::$usNumber));
+ $this->assertEquals(RegionCode::GB, $this->phoneUtil->getRegionCodeForNumber(self::$gbMobile));
+ $this->assertEquals(RegionCode::UN001, $this->phoneUtil->getRegionCodeForNumber(self::$internationalTollFree));
+ }
+
public function testCanBeInternationallyDialled() {
// We have no-international-dialling rules for the US in our test metadata that say that
// toll-free numbers cannot be dialled internationally.

0 comments on commit b0a589f

Please sign in to comment.