1.20.x link.validate.test LinkValidateUnitTest::testValidateInternalLinks()

File

modules/link/tests/link.validate.test, line 176
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 testValidateInternalLinks() {
  $links = array(
    'node/5',
    'feeds/rss.xml',
    'files/test.jpg',
    '/var/www/test',
  );

  foreach ($links as $link) {
    $valid = link_validate_url($link);
    $this->assertEqual(LINK_INTERNAL, $valid, 'Test ' . $link . ' internal link.');
  }
}