You are here

public function LinkSanitizeTest::testAbsoluteHash in Link 7

Test that relative hash URLs can be turned into absolute URLs.

File

tests/LinkSanitizeTest.test, line 75

Class

LinkSanitizeTest
Test for _link_sanitize().

Code

public function testAbsoluteHash() {
  $item['url'] = '#hash-only';
  list($field, $instance, $entity) = $this
    ->generateParams(array(
    'absolute_url' => TRUE,
  ));
  _link_sanitize($item, NULL, $field, $instance, $entity);
  $this
    ->assertEqual('test-path', $item['url']);
  $this
    ->assertEqual(NULL, $item['query']);
  $this
    ->assertEqual('hash-only', $item['fragment']);
}