function FeedIconTest::testFeedIconEscaping
7.x common.test | FeedIconTest::testFeedIconEscaping() |
Check that special characters are correctly escaped. Test for issue #1211668.
File
- drupal-7.x/
modules/ simpletest/ tests/ common.test, line 2706 - Tests for common.inc functionality.
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 &"'', 'theme_feed_icon() escapes reserved HTML characters.');
}