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 theme_feed_icon().

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.