You are here

protected function MultiversionWebTestBase::setUp in Multiversion 8.2

Sets up a Drupal site for running functional and integration tests.

Installs Drupal with the installation profile specified in \Drupal\simpletest\WebTestBase::$profile into the prefixed database.

Afterwards, installs any additional modules specified in the static \Drupal\simpletest\WebTestBase::$modules property of each class in the class hierarchy.

After installation all caches are flushed and several configuration values are reset to the values of the parent site executing the test, since the default values may be incompatible with the environment in which tests are being executed.

Overrides WebTestBase::setUp

9 calls to MultiversionWebTestBase::setUp()
CommentStatisticsTest::setUp in src/Tests/CommentStatisticsTest.php
Sets up a Drupal site for running functional and integration tests.
ComplexLcaResolverTest::setUp in src/Tests/ComplexLcaResolverTest.php
Sets up a Drupal site for running functional and integration tests.
ConflictTrackerTest::setUp in src/Tests/ConflictTrackerTest.php
Sets up a Drupal site for running functional and integration tests.
EntityQueryTest::setUp in src/Tests/EntityQueryTest.php
Sets up a Drupal site for running functional and integration tests.
EntityStorageTest::setUp in src/Tests/EntityStorageTest.php
Sets up a Drupal site for running functional and integration tests.

... See full list

9 methods override MultiversionWebTestBase::setUp()
CommentStatisticsTest::setUp in src/Tests/CommentStatisticsTest.php
Sets up a Drupal site for running functional and integration tests.
ComplexLcaResolverTest::setUp in src/Tests/ComplexLcaResolverTest.php
Sets up a Drupal site for running functional and integration tests.
ConflictTrackerTest::setUp in src/Tests/ConflictTrackerTest.php
Sets up a Drupal site for running functional and integration tests.
EntityQueryTest::setUp in src/Tests/EntityQueryTest.php
Sets up a Drupal site for running functional and integration tests.
EntityStorageTest::setUp in src/Tests/EntityStorageTest.php
Sets up a Drupal site for running functional and integration tests.

... See full list

File

src/Tests/MultiversionWebTestBase.php, line 78

Class

MultiversionWebTestBase
Defines a base class for testing the Multiversion module.

Namespace

Drupal\multiversion\Tests

Code

protected function setUp() {
  parent::setUp();
  $this->entityTypeManager = $this->container
    ->get('entity_type.manager');
  $this->uuidIndex = $this->container
    ->get('multiversion.entity_index.uuid');
  $this->revIndex = $this->container
    ->get('multiversion.entity_index.rev');
  $this->revTree = $this->container
    ->get('multiversion.entity_index.rev.tree');
  $this->multiversionManager = $this->container
    ->get('multiversion.manager');
  $this->workspaceManager = $this->container
    ->get('workspaces.manager');
  $this->entityDefinitionUpdateManager = $this->container
    ->get('entity.definition_update_manager');

  // Create Basic page and Article node types.
  if ($this->profile != 'standard') {
    $this
      ->drupalCreateContentType([
      'type' => 'article',
      'name' => 'Article',
    ]);
  }

  // Create comment field on article.
  $this
    ->addDefaultCommentField('node', 'article');
  $test_user = $this
    ->drupalCreateUser([
    'administer workspaces',
    'administer nodes',
  ]);
  $this
    ->drupalLogin($test_user);
}