You are here

protected function TestBase::setUp in Workbench Moderation to Content Moderation 8.2

Same name in this branch
  1. 8.2 tests/src/Functional/TestBase.php \Drupal\Tests\wbm2cm\Functional\TestBase::setUp()
  2. 8.2 tests/src/Kernel/Migration/TestBase.php \Drupal\Tests\wbm2cm\Kernel\Migration\TestBase::setUp()

Overrides KernelTestBase::setUp

3 calls to TestBase::setUp()
BlockContentTest::setUp in tests/src/Kernel/Migration/BlockContentTest.php
MediaTest::setUp in tests/src/Kernel/Migration/MediaTest.php
NodeTest::setUp in tests/src/Kernel/Migration/NodeTest.php
3 methods override TestBase::setUp()
BlockContentTest::setUp in tests/src/Kernel/Migration/BlockContentTest.php
MediaTest::setUp in tests/src/Kernel/Migration/MediaTest.php
NodeTest::setUp in tests/src/Kernel/Migration/NodeTest.php

File

tests/src/Kernel/Migration/TestBase.php, line 36

Class

TestBase
Tests the save-clear-restore migration flow for a single entity type.

Namespace

Drupal\Tests\wbm2cm\Kernel\Migration

Code

protected function setUp() {
  parent::setUp();
  ModerationState::create([
    'id' => 'draft',
    'label' => $this
      ->randomMachineName(),
    'published' => FALSE,
    'default_revision' => FALSE,
  ])
    ->save();
  ModerationState::create([
    'id' => 'review',
    'label' => $this
      ->randomMachineName(),
    'published' => FALSE,
    'default_revision' => FALSE,
  ])
    ->save();
  ModerationState::create([
    'id' => 'published',
    'label' => $this
      ->randomMachineName(),
    'published' => TRUE,
    'default_revision' => TRUE,
  ])
    ->save();
  ConfigurableLanguage::createFromLangcode('fr')
    ->save();
  ConfigurableLanguage::createFromLangcode('hu')
    ->save();
  $this
    ->prepareDatabase();
}