You are here

protected function NormalizerTestBase::setUp in Replication 8

Overrides KernelTestBase::setUp

7 calls to NormalizerTestBase::setUp()
AttachmentNormalizerTest::setUp in tests/src/Kernel/Normalizer/AttachmentNormalizerTest.php
BulkDocsNormalizerTest::setUp in tests/src/Kernel/Normalizer/BulkDocsNormalizerTest.php
ContentEntityNormalizerAlterTest::setUp in tests/src/Kernel/Normalizer/ContentEntityNormalizerAlterTest.php
ContentEntityNormalizerTest::setUp in tests/src/Kernel/Normalizer/ContentEntityNormalizerTest.php
LinkItemNormalizerTest::setUp in tests/src/Kernel/Normalizer/LinkItemNormalizerTest.php

... See full list

7 methods override NormalizerTestBase::setUp()
AttachmentNormalizerTest::setUp in tests/src/Kernel/Normalizer/AttachmentNormalizerTest.php
BulkDocsNormalizerTest::setUp in tests/src/Kernel/Normalizer/BulkDocsNormalizerTest.php
ContentEntityNormalizerAlterTest::setUp in tests/src/Kernel/Normalizer/ContentEntityNormalizerAlterTest.php
ContentEntityNormalizerTest::setUp in tests/src/Kernel/Normalizer/ContentEntityNormalizerTest.php
LinkItemNormalizerTest::setUp in tests/src/Kernel/Normalizer/LinkItemNormalizerTest.php

... See full list

File

tests/src/Kernel/Normalizer/NormalizerTestBase.php, line 39

Class

NormalizerTestBase

Namespace

Drupal\Tests\replication\Kernel\Normalizer

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('entity_test');
  $this
    ->installEntitySchema('entity_test_mul');
  $this
    ->installEntitySchema('entity_test_mulrev');
  $this
    ->installEntitySchema('entity_test_rev');
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('workspace');
  $this
    ->installEntitySchema('file');
  $this
    ->installEntitySchema('replication_log');
  $this
    ->installSchema('file', 'file_usage');
  $this
    ->installSchema('system', [
    'key_value_expire',
    'sequences',
    'url_alias',
    'router',
  ]);
  $this
    ->installSchema('key_value', [
    'key_value_sorted',
  ]);
  $this
    ->installConfig([
    'multiversion',
    'replication',
    'language',
    'field',
  ]);
  $this->container
    ->get('multiversion.manager')
    ->enableEntityTypes();
  $this->container
    ->get('router.builder')
    ->rebuild();

  // Auto-create a field for testing.
  FieldStorageConfig::create([
    'entity_type' => 'entity_test_mulrev',
    'field_name' => 'field_test_text',
    'type' => 'text',
    'cardinality' => 1,
    'translatable' => TRUE,
  ])
    ->save();
  FieldConfig::create([
    'entity_type' => 'entity_test_mulrev',
    'field_name' => 'field_test_text',
    'bundle' => 'entity_test_mulrev',
    'label' => 'Test text-field',
    'widget' => [
      'type' => 'text_textfield',
      'weight' => 0,
    ],
  ])
    ->save();
  $this->serializer = $this->container
    ->get('serializer');

  // Create default workspace.
  Workspace::create([
    'machine_name' => 'live',
    'label' => 'Live',
    'type' => 'basic',
  ])
    ->save();
}