You are here

protected function WorkspaceIntegrationTest::setUp in Workspace 8.2

Overrides KernelTestBase::setUp

File

tests/src/Kernel/WorkspaceIntegrationTest.php, line 66

Class

WorkspaceIntegrationTest
Tests a complete deployment scenario across different workspaces.

Namespace

Drupal\Tests\workspace\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this->entityTypeManager = \Drupal::entityTypeManager();
  $this
    ->installConfig([
    'filter',
    'node',
    'system',
  ]);
  $this
    ->installSchema('system', [
    'key_value_expire',
    'sequences',
  ]);
  $this
    ->installSchema('node', [
    'node_access',
  ]);
  $this
    ->installEntitySchema('entity_test_mulrev');
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('user');
  $this
    ->createContentType([
    'type' => 'page',
  ]);
  $this
    ->setCurrentUser($this
    ->createUser([
    'administer nodes',
  ]));

  // Create two nodes, a published and an unpublished one, so we can test the
  // behavior of the module with default/existing content.
  $this->createdTimestamp = \Drupal::time()
    ->getRequestTime();
  $this
    ->createNode([
    'title' => 'live - 1 - r1 - published',
    'created' => $this->createdTimestamp++,
    'status' => TRUE,
  ]);
  $this
    ->createNode([
    'title' => 'live - 2 - r2 - unpublished',
    'created' => $this->createdTimestamp++,
    'status' => FALSE,
  ]);
}