1 link.sanitize.test public LinkSanitizeTest::testBlankTitleWithQueryAndFragment()

Test that query URLs can be turned into absolute URLs.

File

core/modules/link/tests/link.sanitize.test, line 165
Contains simpletests for sanitization.

Class

LinkSanitizeTest
Test for _link_sanitize().

Code

public function testBlankTitleWithQueryAndFragment() {
  $item['title'] = '';
  $item['url'] = 'https://www.backdropcms.org/?page=42#something';
  list($field, $instance, $entity) = $this->generateParams();
  // Disable the URL cutoff to confirm the URL.
  $instance['settings']['display']['url_cutoff'] = FALSE;
  _link_sanitize($item, 0, $field, $instance, $entity);
  $this->assertEqual('https://www.backdropcms.org/?page=42#something', $item['display_url']);
  $this->assertEqual('https://www.backdropcms.org/?page=42#something', $item['url']);
}