MultiversionWebTestBase.php in Multiversion 8.2
File
src/Tests/MultiversionWebTestBase.php
View source
<?php
namespace Drupal\multiversion\Tests;
use Drupal\comment\Tests\CommentTestTrait;
use Drupal\simpletest\WebTestBase;
abstract class MultiversionWebTestBase extends WebTestBase {
use CommentTestTrait;
protected $strictConfigSchema = FALSE;
protected $uuidIndex;
protected $revIndex;
protected $revTree;
protected $entityTypeManager;
protected $multiversionManager;
protected $workspaceManager;
protected $entityDefinitionUpdateManager;
public static $modules = [
'workspaces',
'entity_test',
'multiversion',
'node',
'taxonomy',
'comment',
'block_content',
'menu_link_content',
'file',
'shortcut',
'config',
'system',
];
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');
if ($this->profile != 'standard') {
$this
->drupalCreateContentType([
'type' => 'article',
'name' => 'Article',
]);
}
$this
->addDefaultCommentField('node', 'article');
$test_user = $this
->drupalCreateUser([
'administer workspaces',
'administer nodes',
]);
$this
->drupalLogin($test_user);
}
}