You are here

function FeedIconTest::testFeedIconEscaping in Drupal 7

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

File

modules/simpletest/tests/common.test, line 3141
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 &amp;&quot;&#039;', 'theme_feed_icon() escapes reserved HTML characters.');
}