You are here

protected function StandardTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 27
Contains \Drupal\Tests\editor\Unit\EditorXssFilter\StandardTest.

Class

StandardTest
@coversDefaultClass \Drupal\editor\EditorXssFilter\Standard @group editor

Namespace

Drupal\Tests\editor\Unit\EditorXssFilter

Code

protected function setUp() {

  // Mock text format configuration entity object.
  $this->format = $this
    ->getMockBuilder('\\Drupal\\filter\\Entity\\FilterFormat')
    ->disableOriginalConstructor()
    ->getMock();
  $this->format
    ->expects($this
    ->any())
    ->method('getFilterTypes')
    ->will($this
    ->returnValue(array(
    FilterInterface::TYPE_HTML_RESTRICTOR,
  )));
  $restrictions = array(
    'allowed' => array(
      'p' => TRUE,
      'a' => TRUE,
      '*' => array(
        'style' => FALSE,
        'on*' => FALSE,
      ),
    ),
  );
  $this->format
    ->expects($this
    ->any())
    ->method('getHtmlRestrictions')
    ->will($this
    ->returnValue($restrictions));
}