function StandardTest::setUp
Same name in other branches
- 9 core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php \Drupal\Tests\editor\Unit\EditorXssFilter\StandardTest::setUp()
- 8.9.x core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php \Drupal\Tests\editor\Unit\EditorXssFilter\StandardTest::setUp()
- 11.x core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php \Drupal\Tests\editor\Unit\EditorXssFilter\StandardTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ editor/ tests/ src/ Unit/ EditorXssFilter/ StandardTest.php, line 31
Class
- StandardTest
- @coversDefaultClass \Drupal\editor\EditorXssFilter\Standard @group editor
Namespace
Drupal\Tests\editor\Unit\EditorXssFilterCode
protected function setUp() : void {
parent::setUp();
// Mock text format configuration entity object.
$this->format = $this->getMockBuilder('\\Drupal\\filter\\Entity\\FilterFormat')
->disableOriginalConstructor()
->getMock();
$this->format
->expects($this->any())
->method('getFilterTypes')
->willReturn([
FilterInterface::TYPE_HTML_RESTRICTOR,
]);
$restrictions = [
'allowed' => [
'p' => TRUE,
'a' => TRUE,
'*' => [
'style' => FALSE,
'on*' => FALSE,
],
],
];
$this->format
->expects($this->any())
->method('getHtmlRestrictions')
->willReturn($restrictions);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.