You are here

protected function ViewsDataIntegrationTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php \Drupal\Tests\content_moderation\Kernel\ViewsDataIntegrationTest::setUp()

Parameters

bool $import_test_views: Should the views specified on the test class be imported. If you need to setup some additional stuff, like fields, you need to call false and then call createTestViews for your own.

Overrides ViewsKernelTestBase::setUp

File

core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php, line 34

Class

ViewsDataIntegrationTest
Tests the views integration of content_moderation.

Namespace

Drupal\Tests\content_moderation\Kernel

Code

protected function setUp($import_test_views = TRUE) : void {
  parent::setUp($import_test_views);
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('entity_test_mulrevpub');
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('content_moderation_state');
  $this
    ->installSchema('node', 'node_access');
  $this
    ->installConfig('content_moderation');
  $node_type = NodeType::create([
    'type' => 'page',
  ]);
  $node_type
    ->save();
  $workflow = $this
    ->createEditorialWorkflow();
  $workflow
    ->getTypePlugin()
    ->addEntityTypeAndBundle('node', 'page');
  $workflow
    ->getTypePlugin()
    ->addEntityTypeAndBundle('entity_test_mulrevpub', 'entity_test_mulrevpub');
  $workflow
    ->save();
  $this
    ->installConfig('content_moderation_test_views');
}