You are here

protected function LinkStubReplicationTest::setUp in Replication 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/LinkStubReplicationTest.php \Drupal\Tests\replication\Kernel\LinkStubReplicationTest::setUp()

Overrides KernelTestBase::setUp

File

tests/src/Kernel/LinkStubReplicationTest.php, line 39

Class

LinkStubReplicationTest
Tests link stub replication.

Namespace

Drupal\Tests\replication\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('replication_log');
  $this
    ->installEntitySchema('workspace');
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('user');
  $this
    ->installSchema('key_value', [
    'key_value_sorted',
  ]);
  $this
    ->installSchema('system', [
    'sequences',
  ]);
  $this
    ->installSchema('node', [
    'node_access',
  ]);
  $this
    ->installConfig([
    'multiversion',
    'replication',
  ]);
  Workspace::create([
    'machine_name' => 'live',
    'label' => 'Live',
    'type' => 'basic',
  ])
    ->save();
  $this->container
    ->get('multiversion.manager')
    ->enableEntityTypes();
  $this->serializer = $this->container
    ->get('serializer');
  NodeType::create([
    'type' => 'article_with_link',
    'name' => 'article_with_link',
  ])
    ->save();
  NodeType::create([
    'type' => 'article',
    'name' => 'article',
  ])
    ->save();
  $this
    ->createLinkField('node', 'article_with_link', 'field_link');
  $this
    ->createTextField('node', 'article', 'field_test');
}