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