ModerationDashboardTestBase.php in Moderation Dashboard 2.0.x
File
tests/src/Functional/ModerationDashboardTestBase.php
View source
<?php
namespace Drupal\Tests\moderation_dashboard\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
abstract class ModerationDashboardTestBase extends BrowserTestBase {
use ContentModerationTestTrait;
protected $defaultTheme = 'classy';
public static $modules = [
'moderation_dashboard',
];
public $userPermissions = [
'access content',
'use moderation dashboard',
'view all revisions',
'view any moderation dashboard',
];
public $setEditorialWorkflow = TRUE;
public $testNodeTypes = [
[
'type' => 'page',
],
];
protected $user;
protected $editorialWorkflow;
protected function setUp() {
parent::setUp();
foreach ($this->testNodeTypes as $node_type_properties) {
$this
->drupalCreateContentType($node_type_properties);
}
$this->editorialWorkflow = $this
->createEditorialWorkflow();
if ($this->setEditorialWorkflow) {
foreach ($this->testNodeTypes as $node_type_properties) {
$this->editorialWorkflow
->getTypePlugin()
->addEntityTypeAndBundle('node', $node_type_properties['type']);
}
$this->editorialWorkflow
->save();
}
$this->user = $this
->createUser($this->userPermissions, 'test user');
}
}