<?php
-namespace Drupal\block\Tests;
+namespace Drupal\Tests\block\Functional;
use Drupal\block_content\Entity\BlockContent;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\Core\Url;
-use Drupal\simpletest\WebTestBase;
use Drupal\system\Entity\Menu;
+use Drupal\Tests\BrowserTestBase;
use Drupal\views\Entity\View;
/**
*
* @group block
*/
-class BlockXssTest extends WebTestBase {
+class BlockXssTest extends BrowserTestBase {
/**
* Modules to install.
public function testNoUnexpectedEscaping() {
$this->drupalLogin($this->drupalCreateUser(['administer blocks', 'access administration pages']));
$this->drupalGet(Url::fromRoute('block.admin_display'));
- $this->clickLinkPartialName('Place block');
+ $this->clickLink('Place block');
$this->assertNoEscaped('<');
}
$this->drupalPlaceBlock('test_xss_title');
$this->drupalLogin($this->drupalCreateUser(['administer blocks', 'access administration pages']));
$this->drupalGet(Url::fromRoute('block.admin_display'));
- $this->clickLinkPartialName('Place block');
+ $this->clickLink('Place block');
$this->assertNoRaw("<script>alert('XSS category');</script>");
}
$this->doBlockContentTest();
$this->drupalGet(Url::fromRoute('block.admin_display'));
- $this->clickLinkPartialName('Place block');
+ $this->clickLink('Place block');
$this->assertNoRaw('&lt;', 'The page does not have double escaped HTML tags.');
}
$view->save();
$this->drupalGet(Url::fromRoute('block.admin_display'));
- $this->clickLinkPartialName('Place block');
+ $this->clickLink('Place block');
// \Drupal\views\Plugin\Derivative\ViewsBlock::getDerivativeDefinitions()
// has a different code path for an admin label based only on the View
])->save();
$this->drupalGet(Url::fromRoute('block.admin_display'));
- $this->clickLinkPartialName('Place block');
+ $this->clickLink('Place block');
$this->assertEscaped('<script>alert("menu");</script>');
$this->assertNoRaw('<script>alert("menu");</script>');
])->save();
$this->drupalGet(Url::fromRoute('block.admin_display'));
- $this->clickLinkPartialName('Place block');
+ $this->clickLink('Place block');
$this->assertEscaped('<script>alert("block_content");</script>');
$this->assertNoRaw('<script>alert("block_content");</script>');