File
- core/modules/link/tests/link.validate.test, line 235
- Tests that exercise the validation functions in the link module.
Class
- LinkValidateUnitTest
- A series of tests of links, only going against the link_validate_url function in link.module.
Code
function testInvalidExternalLinks() {
$links = array(
'http://www.ex ample.com/',
'http://@www.example.com/',
'http://username:@www.example.com/',
'http://25.0.0/', 'http://4827.0.0.2/',
'//www.example.com/',
'http://www.-fudge.com/', );
foreach ($links as $link) {
$valid = link_validate_url($link);
$this->assertEqual(FALSE, $valid, 'Testing that ' . $link . ' is not a valid link.');
}
}