You are here

public function LinkSanitizeTest::testAbsoluteQuery in Link 7

Test that query URLs can be turned into absolute URLs.

File

tests/LinkSanitizeTest.test, line 99

Class

LinkSanitizeTest
Test for _link_sanitize().

Code

public function testAbsoluteQuery() {
  $item['url'] = '?query=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(array(
    'query' => 'only',
  ), $item['query']);
  $this
    ->assertEqual(NULL, $item['fragment']);
}