You are here

public function TelephoneFormatterUnitTest::testFormatterLibraryInteraction in Telephone Formatter 7

Test formatter - library interaction.

File

tests/TelephoneFormatterUnitTest.test, line 23

Class

TelephoneFormatterUnitTest

Code

public function testFormatterLibraryInteraction() {
  $test_country = 'NO';
  $test_value = '98765432';
  $this
    ->assertEqual('987 65 432', _telephone_formatter_get_formatted_value($test_value, PhoneNumberFormat::NATIONAL, $test_country));
  $this
    ->assertEqual('+47 987 65 432', _telephone_formatter_get_formatted_value($test_value, PhoneNumberFormat::INTERNATIONAL, $test_country));
  $this
    ->assertEqual('+4798765432', _telephone_formatter_get_formatted_value($test_value, PhoneNumberFormat::E164, $test_country));
  $this
    ->assertEqual('tel:+47-987-65-432', _telephone_formatter_get_formatted_value($test_value, PhoneNumberFormat::RFC3966, $test_country));
}