public function LinkValidationApiTest::testValidateTelLinksBad in Link 7
Confirm that invalid tel: links work as expected.
File
- tests/
LinkValidationApiTest.test, line 117 - Validate the link_validate_url() validation API.
Class
- LinkValidationApiTest
- Validate the link_validate_url() validation API.
Code
public function testValidateTelLinksBad() {
$links = array(
'tel:0',
'tel:1234567890123456',
'tel:+1',
'tel:+0123456789',
'tel:+1234567890123456',
':12345678',
);
foreach ($links as $link) {
$type = link_url_type($link);
$this
->assertFalse($type, 'Test ' . $link . ' is not a tel link.');
$valid = link_validate_url($link);
$this
->assertFalse($valid, 'Test ' . $link . ' is not a valid tel link.');
}
}