Commit 34637de7 authored by catch's avatar catch

Issue #2952307 by chr.fritsch, Sam152, timmillwood: Move workflow config into standard profile

parent e60979f1
......@@ -3,7 +3,7 @@
namespace Drupal\Tests\book\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* Tests Book and Content Moderation integration.
......@@ -13,6 +13,7 @@
class BookContentModerationTest extends BrowserTestBase {
use BookTestTrait;
use ContentModerationTestTrait;
/**
* Modules to install.
......@@ -30,7 +31,7 @@ protected function setUp() {
$this->drupalPlaceBlock('system_breadcrumb_block');
$this->drupalPlaceBlock('page_title_block');
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'book');
$workflow->save();
......
......@@ -3,7 +3,7 @@
namespace Drupal\Tests\content_moderation\Functional;
use Drupal\Tests\BrowserTestBase;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* Tests moderated content administration page functionality.
......@@ -12,6 +12,8 @@
*/
class ModeratedContentViewTest extends BrowserTestBase {
use ContentModerationTestTrait;
/**
* A user with permission to bypass access content.
*
......@@ -34,7 +36,7 @@ public function setUp() {
$this->drupalCreateContentType(['type' => 'article', 'name' => 'Article'])->save();
$this->drupalCreateContentType(['type' => 'unmoderated_type', 'name' => 'Unmoderated type'])->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'page');
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'article');
$workflow->save();
......
......@@ -5,7 +5,7 @@
use Drupal\node\Entity\Node;
use Drupal\simpletest\ContentTypeCreationTrait;
use Drupal\Tests\BrowserTestBase;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* Test the content moderation actions.
......@@ -15,6 +15,7 @@
class ModerationActionsTest extends BrowserTestBase {
use ContentTypeCreationTrait;
use ContentModerationTestTrait;
/**
* Modules to enable.
......@@ -38,7 +39,7 @@ public function setUp() {
$standard_bundle = $this->createContentType(['type' => 'standard_bundle']);
$standard_bundle->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'moderated_bundle');
$workflow->save();
......
......@@ -3,7 +3,6 @@
namespace Drupal\Tests\content_moderation\Functional;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
use Drupal\workflows\Entity\Workflow;
use Drupal\Core\Url;
/**
......@@ -157,9 +156,8 @@ public function testModerationForm() {
*/
public function testNonBundleModerationForm() {
$this->drupalLogin($this->rootUser);
$workflow = Workflow::load('editorial');
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_mulrevpub', 'entity_test_mulrevpub');
$workflow->save();
$this->workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_mulrevpub', 'entity_test_mulrevpub');
$this->workflow->save();
// Create new moderated content in draft.
$this->drupalPostForm('entity_test_mulrevpub/add', ['moderation_state[0][state]' => 'draft'], t('Save'));
......
......@@ -4,7 +4,7 @@
use Drupal\simpletest\ContentTypeCreationTrait;
use Drupal\Tests\BrowserTestBase;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* Test revision revert.
......@@ -14,6 +14,7 @@
class ModerationRevisionRevertTest extends BrowserTestBase {
use ContentTypeCreationTrait;
use ContentModerationTestTrait;
/**
* Modules to enable.
......@@ -34,7 +35,7 @@ public function setUp() {
$moderated_bundle = $this->createContentType(['type' => 'moderated_bundle']);
$moderated_bundle->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'moderated_bundle');
$workflow->save();
......
......@@ -5,7 +5,7 @@
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\BrowserTestBase;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* Tests the view access control handler for moderation state entities.
......@@ -14,6 +14,8 @@
*/
class ModerationStateAccessTest extends BrowserTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -99,7 +101,7 @@ protected function createNodeType($label, $machine_name) {
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', $machine_name);
$workflow->save();
return $node_type;
......
......@@ -5,6 +5,7 @@
use Drupal\Core\Session\AccountInterface;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
use Drupal\user\Entity\Role;
/**
......@@ -12,6 +13,8 @@
*/
abstract class ModerationStateTestBase extends BrowserTestBase {
use ContentModerationTestTrait;
/**
* Profile to use.
*
......@@ -46,6 +49,13 @@ abstract class ModerationStateTestBase extends BrowserTestBase {
'use editorial transition archived_published',
];
/**
* The editorial workflow entity.
*
* @var \Drupal\workflows\Entity\Workflow
*/
protected $workflow;
/**
* Modules to enable.
*
......@@ -64,6 +74,7 @@ abstract class ModerationStateTestBase extends BrowserTestBase {
*/
protected function setUp() {
parent::setUp();
$this->workflow = $this->createEditorialWorkflow();
$this->adminUser = $this->drupalCreateUser($this->permissions);
$this->drupalPlaceBlock('local_tasks_block', ['id' => 'tabs_block']);
$this->drupalPlaceBlock('page_title_block');
......
......@@ -3,6 +3,7 @@
namespace Drupal\Tests\content_moderation\Functional;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
use Drupal\Tests\views\Functional\ViewTestBase;
use Drupal\views\ViewExecutable;
use Drupal\views\Views;
......@@ -17,6 +18,8 @@
*/
class ViewsModerationStateFilterTest extends ViewTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -45,6 +48,8 @@ protected function setUp($import_test_views = TRUE) {
'type' => 'example_b',
])->save();
$this->createEditorialWorkflow();
$new_workflow = Workflow::create([
'type' => 'content_moderation',
'id' => 'new_workflow',
......
......@@ -6,7 +6,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* Test the ContentModerationState storage schema.
......@@ -16,6 +16,8 @@
*/
class ContentModerationStateStorageSchemaTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -45,7 +47,7 @@ protected function setUp() {
NodeType::create([
'type' => 'example',
])->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
}
......
......@@ -12,6 +12,7 @@
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
use Drupal\workflows\Entity\Workflow;
/**
......@@ -21,6 +22,8 @@
*/
class ContentModerationStateTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -275,7 +278,7 @@ public function testMultilingualModeration() {
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
......@@ -388,7 +391,7 @@ public function testModerationWithFieldConfigOverride() {
'type' => 'test_type',
])->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'test_type');
$workflow->save();
......@@ -415,7 +418,7 @@ public function testModerationWithFieldConfigOverride() {
* Tests that entities with special languages can be moderated.
*/
public function testModerationWithSpecialLanguages() {
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_rev', 'entity_test_rev');
$workflow->save();
......@@ -436,7 +439,7 @@ public function testModerationWithSpecialLanguages() {
* Tests that a non-translatable entity type with a langcode can be moderated.
*/
public function testNonTranslatableEntityTypeModeration() {
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_rev', 'entity_test_rev');
$workflow->save();
......@@ -470,7 +473,7 @@ public function testNonLangcodeEntityTypeModeration() {
// Update the entity type in order to remove the 'langcode' field.
\Drupal::entityDefinitionUpdateManager()->applyUpdates();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_rev', 'entity_test_rev');
$workflow->save();
......@@ -500,7 +503,7 @@ public function testWorkflowDependencies() {
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
// Test both a config and non-config based bundle and entity type.
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_rev', 'entity_test_rev');
......@@ -543,7 +546,7 @@ public function testWorkflowNonConfigBundleDependencies() {
// Create a bundle not based on any particular configuration.
entity_test_create_bundle('test_bundle');
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test', 'test_bundle');
$workflow->save();
......@@ -653,7 +656,7 @@ protected function createEntity($entity_type_id) {
}
}
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle($entity_type_id, $bundle_id);
$workflow->save();
......
......@@ -6,7 +6,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* Tests how Content Moderation handles workflow config changes.
......@@ -15,6 +15,8 @@
*/
class ContentModerationWorkflowConfigTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -63,7 +65,7 @@ protected function setUp() {
'type' => 'example',
])->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()
->addState('test1', 'Test one')
->addState('test2', 'Test two')
......
......@@ -6,7 +6,7 @@
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* Tests the correct default revision is set.
......@@ -15,6 +15,8 @@
*/
class DefaultRevisionStateTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -68,7 +70,7 @@ public function testMultilingual() {
$this->container->get('content_translation.manager')->setEnabled('node', 'example', TRUE);
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
......
......@@ -5,7 +5,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* @coversDefaultClass \Drupal\content_moderation\EntityOperations
......@@ -14,6 +14,8 @@
*/
class EntityOperationsTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -48,7 +50,7 @@ protected function createNodeType() {
'label' => 'Page',
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'page');
$workflow->save();
}
......
......@@ -6,7 +6,7 @@
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* @coversDefaultClass \Drupal\content_moderation\Plugin\Validation\Constraint\ModerationStateConstraintValidator
......@@ -14,6 +14,8 @@
*/
class EntityStateChangeValidationTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -50,7 +52,7 @@ public function testValidTransition() {
'type' => 'example',
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
......@@ -78,7 +80,7 @@ public function testInvalidTransition() {
'type' => 'example',
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
......@@ -104,7 +106,7 @@ public function testInvalidState() {
'type' => 'example',
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
......@@ -136,7 +138,7 @@ public function testInvalidStateWithoutExisting() {
// Enable moderation to test validation on existing content, with no
// explicit state.
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addState('deleted_state', 'Deleted state');
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
......@@ -169,7 +171,7 @@ public function testInvalidStateMultilingual() {
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
......@@ -232,7 +234,7 @@ public function testExistingContentWithNoModeration() {
$nid = $node->id();
// Enable moderation for our node type.
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
......@@ -278,7 +280,7 @@ public function testExistingMultilingualContentWithNoModeration() {
$node_fr->save();
// Enable moderation for our node type.
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
......
......@@ -6,7 +6,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* Tests the correct initial states are set on install.
......@@ -15,6 +15,8 @@
*/
class InitialStateTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -66,7 +68,7 @@ public function testInitialState() {
$entity_test->save();
\Drupal::service('module_installer')->install(['content_moderation'], TRUE);
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_rev', 'entity_test_rev');
$workflow->save();
......
......@@ -6,7 +6,7 @@
use Drupal\entity_test\Entity\EntityTestRev;
use Drupal\KernelTests\KernelTestBase;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* @coversDefaultClass \Drupal\content_moderation\ModerationInformation
......@@ -14,6 +14,8 @@
*/
class ModerationInformationTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -48,7 +50,7 @@ protected function setUp() {
ConfigurableLanguage::createFromLangcode('de')->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_mulrevpub', 'entity_test_mulrevpub');
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_rev', 'entity_test_rev');
$workflow->save();
......
......@@ -5,7 +5,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* @coversDefaultClass \Drupal\content_moderation\Plugin\Field\ModerationStateFieldItemList
......@@ -14,6 +14,8 @@
*/
class ModerationStateFieldItemListTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -51,7 +53,7 @@ protected function setUp() {
'type' => 'example',
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->save();
......
......@@ -8,7 +8,7 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* @coversDefaultClass \Drupal\content_moderation\Plugin\Field\FieldWidget\ModerationStateWidget
......@@ -16,6 +16,8 @@
*/
class ModerationStateWidgetTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* Modules to install.
*
......@@ -46,7 +48,7 @@ protected function setUp() {
'type' => 'unmoderated',
])->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'moderated');
$workflow->save();
}
......
......@@ -4,9 +4,9 @@
use Drupal\KernelTests\KernelTestBase;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
use Drupal\Tests\node\Traits\NodeCreationTrait;
use Drupal\Tests\user\Traits\UserCreationTrait;
use Drupal\workflows\Entity\Workflow;
/**
* Tests with node access enabled.
......@@ -17,6 +17,7 @@ class NodeAccessTest extends KernelTestBase {
use NodeCreationTrait;
use UserCreationTrait;
use ContentModerationTestTrait;
/**
* The moderation information service.
......@@ -58,7 +59,7 @@ protected function setUp() {
'label' => 'Page',
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'page');
$workflow->save();
......
......@@ -5,7 +5,7 @@
use Drupal\Core\Render\RenderContext;
use Drupal\entity_test\Entity\EntityTestRev;
use Drupal\KernelTests\KernelTestBase;
use Drupal\workflows\Entity\Workflow;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
/**
* Test the state field formatter.
......@@ -14,6 +14,8 @@
*/
class StateFormatterTest extends KernelTestBase {
use ContentModerationTestTrait;
/**
* Modules to enable.
*
......@@ -36,7 +38,7 @@ protected function setUp() {
$this->installEntitySchema('content_moderation_state');
$this->installConfig('content_moderation');
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_rev', 'entity_test_rev');
$workflow->save();
}
......
......@@ -4,9 +4,9 @@
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
use Drupal\views\Views;
use Drupal\workflows\Entity\Workflow;
/**
* Tests the views integration of content_moderation.
......@@ -15,6 +15,8 @@
*/
class ViewsDataIntegrationTest extends ViewsKernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -44,7 +46,7 @@ protected function setUp($import_test_views = TRUE) {
'type' => 'page',
]);
$node_type->save();
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'page');
$workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_mulrevpub', 'entity_test_mulrevpub');
$workflow->save();
......
......@@ -6,6 +6,7 @@
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\node\Entity\Node;
use Drupal\node\Entity\NodeType;
use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
use Drupal\Tests\views\Kernel\ViewsKernelTestBase;
use Drupal\views\Views;
use Drupal\workflows\Entity\Workflow;
......@@ -19,6 +20,8 @@
*/
class ViewsModerationStateFilterTest extends ViewsKernelTestBase {
use ContentModerationTestTrait;
/**
* {@inheritdoc}
*/
......@@ -69,7 +72,7 @@ protected function setUp($import_test_views = TRUE) {
* Tests the content moderation state filter.
*/
public function testStateFilterViewsRelationship() {
$workflow = Workflow::load('editorial');
$workflow = $this->createEditorialWorkflow();
$workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'example');
$workflow->getTypePlugin()->addState('translated_draft', 'Bar');
$configuration = $workflow->getTypePlugin()->getConfiguration();
......@@ -156,7 +159,7 @@ public function testStateFilterViewsRelationship() {