You are here

public function BlockXssTest::testBlockXss in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/block/tests/src/Functional/BlockXssTest.php \Drupal\Tests\block\Functional\BlockXssTest::testBlockXss()

Tests various modules that provide blocks for XSS.

File

core/modules/block/tests/src/Functional/BlockXssTest.php, line 82

Class

BlockXssTest
Tests that the block module properly escapes block descriptions.

Namespace

Drupal\Tests\block\Functional

Code

public function testBlockXss() {
  $this
    ->drupalLogin($this->rootUser);
  $this
    ->doViewTest();
  $this
    ->doMenuTest();
  $this
    ->doBlockContentTest();
  $this
    ->drupalGet(Url::fromRoute('block.admin_display'));
  $this
    ->clickLink('Place block');
  $this
    ->assertNoRaw('<', 'The page does not have double escaped HTML tags.');
}