1 link.sanitize.test | public LinkSanitizeTest::testBlankTitleWithQuery() |
Test that query URLs can be turned into absolute URLs.
File
- core/
modules/ link/ tests/ link.sanitize.test, line 123 - Contains simpletests for sanitization.
Class
- LinkSanitizeTest
- Test for _link_sanitize().
Code
public function testBlankTitleWithQuery() {
$item['title'] = '';
$item['url'] = 'https://www.backdropcms.org/?page=42';
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', $item['display_url']);
$this->assertEqual('https://www.backdropcms.org/?page=42', $item['url']);
}