1 link.validate.test LinkValidateTest::testUrls()

Test all the common URL structures in the UI.

Each of these tests creates a new node and ensures that the value of the URL is stored properly in the database.

File

core/modules/link/tests/link.validate.test, line 57
Tests that exercise the validation functions in the link module.

Class

LinkValidateTest

Code

function testUrls() {
  $this->validateUrl('http://www.example.com');
  $this->validateUrl('<front>');
  $this->validateUrl('node/32');
  $this->validateUrl('mailto:john@example.com');
  $this->validateUrl('https://www.example.com/');
  $this->validateUrl('ftp://www.example.com/');
  // cspell:disable
  $this->validateUrl('http://üÜü.exämple.com/nöde');
  $this->validateUrl('mailto:Üser@exÅmple.com');
  $this->validateUrl('http://www.test.com/ßstuff');
  $this->validateUrl('http://www.testÑñ.com/');
  // cspell:enable
  $this->validateUrl('http://www.healthyteennetwork.org/index.asp?Type=B_PR&SEC={2AE1D600-4FC6-4B4D-8822-F1D5F072ED7B}&DE={235FD1E7-208D-4363-9854-4E6775EB8A4C}');
  $this->validateUrl('http://th.wikipedia.org/wiki/%E0%B9%82%E0%B8%A3%E0%B8%87%E0%B9%80%E0%B8%A3%E0%B8%B5%E0%B8%A2%E0%B8%99%E0%B9%80%E0%B8%9A%E0%B8%8D%E0%B8%88%E0%B8%A1%E0%B8%A3%E0%B8%B2%E0%B8%8A%E0%B8%B9%E0%B8%97%E0%B8%B4%E0%B8%A8_%E0%B8%99%E0%B8%84%E0%B8%A3%E0%B8%A8%E0%B8%A3%E0%B8%B5%E0%B8%98%E0%B8%A3%E0%B8%A3%E0%B8%A1%E0%B8%A3%E0%B8%B2%E0%B8%8A');
  $this->validateUrl('news:comp.info-systems.www.misc');
  $this->validateUrl('news:hj0db8$vrm$1@news.eternal-september.org');
}