function FeedIconTest::testFeedIconEscaping

Check that special characters are correctly escaped. Test for issue #1211668.

File

modules/simpletest/tests/common.test, line 3280

Class

FeedIconTest
Test for <a href="/api/drupal/includes%21theme.inc/function/theme_feed_icon/7.x" title="Returns HTML for a feed icon." class="local">theme_feed_icon</a>().

Code

function testFeedIconEscaping() {
    $variables = array();
    $variables['url'] = 'node';
    $variables['title'] = '<>&"\'';
    $text = theme_feed_icon($variables);
    preg_match('/title="(.*?)"/', $text, $matches);
    $this->assertEqual($matches[1], 'Subscribe to &amp;&quot;&#039;', 'theme_feed_icon() escapes reserved HTML characters.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.