You are here

public function LinkValidationApiTest::testValidateTelLinks in Link 7

Confirm that valid tel: links work as expected.

File

tests/LinkValidationApiTest.test, line 100
Validate the link_validate_url() validation API.

Class

LinkValidationApiTest
Validate the link_validate_url() validation API.

Code

public function testValidateTelLinks() {
  $links = array(
    'tel:01',
    'tel:123456789012345',
    'tel:+123456789012345',
  );
  foreach ($links as $link) {
    $type = link_url_type($link);
    $this
      ->assertEqual(LINK_TEL, $type, 'Test ' . $link . ' is a tel link.');
    $valid = link_validate_url($link);
    $this
      ->assertTrue($valid, 'Test ' . $link . ' is valid tel link.');
  }
}