MultiversionFunctionalTestBase.php in Multiversion 8
File
tests/src/Functional/MultiversionFunctionalTestBase.php
View source
<?php
namespace Drupal\Tests\multiversion\Functional;
use Drupal\comment\Tests\CommentTestTrait;
use Drupal\Tests\BrowserTestBase;
abstract class MultiversionFunctionalTestBase extends BrowserTestBase {
use CommentTestTrait;
protected $strictConfigSchema = FALSE;
protected $uuidIndex;
protected $revIndex;
protected $revTree;
protected $entityTypeManager;
protected $multiversionManager;
protected $workspaceManager;
protected $entityDefinitionUpdateManager;
protected static $modules = [
'entity_test',
'multiversion',
'node',
'taxonomy',
'comment',
'block_content',
'menu_link_content',
'file',
'shortcut',
];
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('workspace.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',
]);
$this
->drupalLogin($test_user);
}
}