You are here

protected function LinkStubReplicationTest::setUp in Replication 8.2

Same name and namespace in other branches
  1. 8 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
    ->installSchema('key_value', [
    'key_value_sorted',
  ]);
  $this
    ->installSchema('system', [
    'sequences',
  ]);
  $this
    ->installSchema('node', [
    'node_access',
  ]);
  $this
    ->installConfig([
    'multiversion',
    'replication',
  ]);
  $this->container
    ->get('multiversion.manager')
    ->enableEntityTypes();
  $this->serializer = $this->container
    ->get('replication.serializer');
  Workspace::create([
    'machine_name' => 'live',
    'label' => 'Live',
    'type' => 'basic',
  ])
    ->save();
  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');
}