You are here

public function LinkSanitizeTest::testBlankTitle in Link 7

Test that query URLs can be turned into absolute URLs.

File

tests/LinkSanitizeTest.test, line 113

Class

LinkSanitizeTest
Test for _link_sanitize().

Code

public function testBlankTitle() {
  $item['title'] = '';
  $item['url'] = 'https://www.drupal.org/';
  list($field, $instance, $entity) = $this
    ->generateParams();

  // Disable the URL cutoff to confirm the URL.
  $instance['settings']['display']['url_cutoff'] = FALSE;
  _link_sanitize($item, NULL, $field, $instance, $entity);
  $this
    ->verbose('<pre>' . print_r($item, TRUE) . '</pre>');
  $this
    ->assertEqual('https://www.drupal.org/', $item['display_url']);
  $this
    ->assertEqual('https://www.drupal.org/', $item['url']);
  $this
    ->assertEqual(array(), $item['query']);
  $this
    ->assertEqual(NULL, $item['fragment']);
}