You are here

protected function ConfigDependenciesTest::setUp in Workbench Access 8

Overrides KernelTestBase::setUp

File

tests/src/Kernel/ConfigDependenciesTest.php, line 61

Class

ConfigDependenciesTest
Defines a class for testing config dependencies.

Namespace

Drupal\Tests\workbench_access\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('node');
  $this
    ->installConfig([
    'filter',
    'node',
    'workbench_access',
    'system',
  ]);
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('taxonomy_term');
  $this
    ->installSchema('system', [
    'key_value',
    'sequences',
  ]);
  $node_type = $this
    ->createContentType([
    'type' => 'page',
  ]);
  $node_type2 = $this
    ->createContentType([
    'type' => 'article',
  ]);
  $this->vocabulary = $this
    ->setUpVocabulary();
  $this
    ->setUpTaxonomyFieldForEntityType('node', $node_type
    ->id(), $this->vocabulary
    ->id());
  $this
    ->setUpTaxonomyFieldForEntityType('node', $node_type
    ->id(), $this->vocabulary
    ->id(), 'field_section');
  $this->scheme = $this
    ->setUpTaxonomyScheme($node_type, $this->vocabulary);
  $configuration = $this->scheme
    ->getAccessScheme()
    ->getConfiguration();
  $configuration['fields'][] = [
    'field' => 'field_section',
    'entity_type' => 'node',
    'bundle' => 'page',
  ];
  $this->scheme
    ->getAccessScheme()
    ->setConfiguration($configuration);
  $this->scheme
    ->save();
  $this->menuScheme = $this
    ->setUpMenuScheme([
    $node_type
      ->id(),
    $node_type2
      ->id(),
  ], [
    'main',
  ], 'menu_scheme');
}