function AddFeedTest::testFeedIconEscaping

Checks that special characters are correctly escaped.

See also

http://drupal.org/node/1211668

File

drupal/core/modules/system/lib/Drupal/system/Tests/Common/AddFeedTest.php, line 98
Definition of Drupal\system\Tests\Common\AddFeedTest.

Class

AddFeedTest
Tests drupal_add_feed().

Namespace

Drupal\system\Tests\Common

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.');
}