You are here

public function LinkSanitizeTest::testBlankTitleWithFragment in Link 7

Test that query URLs can be turned into absolute URLs.

File

tests/LinkSanitizeTest.test, line 175

Class

LinkSanitizeTest
Test for _link_sanitize().

Code

public function testBlankTitleWithFragment() {
  $item['title'] = '';
  $item['url'] = 'https://www.drupal.org/#something';
  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/#something', $item['display_url']);
  $this
    ->assertEqual('https://www.drupal.org/', $item['url']);
  $this
    ->assertEqual(array(), $item['query']);
  $this
    ->assertEqual('something', $item['fragment']);
}