You are here

public function TelephoneFormatterUnitTest::testUnparsableNumber in Telephone Formatter 7

Valid national number but missing region code.

File

tests/TelephoneFormatterUnitTest.test, line 36

Class

TelephoneFormatterUnitTest

Code

public function testUnparsableNumber() {
  try {
    _telephone_formatter_get_formatted_value('98765432', PhoneNumberFormat::NATIONAL);
  } catch (NumberParseException $e) {
    $this
      ->pass('NumberParseException was thrown as expected.');
  } catch (Exception $e) {
    $this
      ->fail('NumberParseException was not thrown for a valid national number but missing region code.');
  }
}