You are here

protected function SchedulerContentModerationTestBase::setUp in Scheduler content moderation integration 8

Overrides KernelTestBase::setUp

3 calls to SchedulerContentModerationTestBase::setUp()
HookImplementationTest::setUp in tests/src/Kernel/HookImplementationTest.php
PublishedStateConstraintTest::setUp in tests/src/Kernel/PublishedStateConstraintTest.php
UnPublishedStateConstraintTest::setUp in tests/src/Kernel/UnPublishedStateConstraintTest.php
3 methods override SchedulerContentModerationTestBase::setUp()
HookImplementationTest::setUp in tests/src/Kernel/HookImplementationTest.php
PublishedStateConstraintTest::setUp in tests/src/Kernel/PublishedStateConstraintTest.php
UnPublishedStateConstraintTest::setUp in tests/src/Kernel/UnPublishedStateConstraintTest.php

File

tests/src/Kernel/SchedulerContentModerationTestBase.php, line 53

Class

SchedulerContentModerationTestBase
Base class for the Scheduler Content Moderation tests.

Namespace

Drupal\Tests\scheduler_content_moderation_integration\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installSchema('node', 'node_access');
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('content_moderation_state');
  $this
    ->installConfig('content_moderation');

  // Scheduler calls some config entity, instead of installing whole modules
  // default config just create the ones we need..
  DateFormat::create([
    'id' => 'long',
    'label' => 'Custom long date',
    'pattern' => 'l, F j, Y - H:i',
  ])
    ->save();
  Action::create([
    'id' => 'node_publish_action',
    'label' => 'Custom node_publish_action',
    'type' => 'node',
    'plugin' => 'entity:publish_action:node',
  ])
    ->save();
  Action::create([
    'id' => 'node_unpublish_action',
    'label' => 'Custom node_unpublish_action',
    'type' => 'node',
    'plugin' => 'entity:unpublish_action:node',
  ])
    ->save();
  $this
    ->configureExampleNodeType();
  $this
    ->configureEditorialWorkflow();
  $this->moderationInfo = \Drupal::service('content_moderation.moderation_information');
}