You are here

public function BlockXssTest::testBlockXss in Zircon Profile 8.0

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

Tests various modules that provide blocks for XSS.

File

core/modules/block/src/Tests/BlockXssTest.php, line 73
Contains \Drupal\block\Tests\BlockXssTest.

Class

BlockXssTest
Tests that the block module properly escapes block descriptions.

Namespace

Drupal\block\Tests

Code

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