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