You are here

protected function FilterAccessTest::setUp in Workbench Access 8

Overrides KernelTestBase::setUp

File

tests/src/Kernel/FilterAccessTest.php, line 69

Class

FilterAccessTest
Tests workbench_access integration with entity_test.

Namespace

Drupal\Tests\workbench_access\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installConfig([
    'filter',
    'entity_test',
    'workbench_access',
  ]);
  $this->scheme = AccessScheme::create([
    'id' => 'editorial_section',
    'label' => 'Editorial section',
    'plural_label' => 'Editorial sections',
    'scheme' => 'workbench_access_filter_test',
    'scheme_settings' => [],
  ]);
  $this->scheme
    ->save();
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('section_association');
  $this
    ->installSchema('system', [
    'key_value',
    'sequences',
  ]);
  $this->accessHandler = $this->container
    ->get('entity_type.manager')
    ->getAccessControlHandler('filter_format');
  $this->filterFormat1 = FilterFormat::create([
    'format' => 'full_html',
    'name' => 'Full HTML',
    'weight' => 1,
    'filters' => [],
  ]);
  $this->filterFormat2 = FilterFormat::create([
    'format' => 'basic_html',
    'name' => 'Basic HTML',
    'weight' => 1,
    'filters' => [
      'filter_html_escape' => [
        'status' => 1,
      ],
    ],
  ]);
}