This method takes into account cases where the number might contain formatting, but doesn't
allow additional digits to be appended.
public isEmergencyNumber ( $number, $regionCode ) : boolean | ||
$number | String The phone number to test | |
$regionCode | String The region where the phone number is being dialed | |
리턴 | boolean | if the number exactly matches an emergency services number in the given region. |
public function testIsEmergencyNumber_ZW() { // Zimbabwe doesn't have any metadata in the test metadata. $this->assertFalse($this->shortUtil->isEmergencyNumber("911", RegionCode::ZW)); $this->assertFalse($this->shortUtil->isEmergencyNumber("01312345", RegionCode::ZW)); $this->assertFalse($this->shortUtil->isEmergencyNumber("0711234567", RegionCode::ZW)); }