Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
222
Merge Requests
222
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
34637de7
Commit
34637de7
authored
Jun 19, 2018
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2952307
by chr.fritsch, Sam152, timmillwood: Move workflow config into standard profile
parent
e60979f1
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
232 additions
and
63 deletions
+232
-63
core/modules/book/tests/src/Functional/BookContentModerationTest.php
...s/book/tests/src/Functional/BookContentModerationTest.php
+3
-2
core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php
...eration/tests/src/Functional/ModeratedContentViewTest.php
+4
-2
core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php
...moderation/tests/src/Functional/ModerationActionsTest.php
+3
-2
core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
...nt_moderation/tests/src/Functional/ModerationFormTest.php
+2
-4
core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php
...ion/tests/src/Functional/ModerationRevisionRevertTest.php
+3
-2
core/modules/content_moderation/tests/src/Functional/ModerationStateAccessTest.php
...ration/tests/src/Functional/ModerationStateAccessTest.php
+4
-2
core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php
...deration/tests/src/Functional/ModerationStateTestBase.php
+11
-0
core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
...n/tests/src/Functional/ViewsModerationStateFilterTest.php
+5
-0
core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php
...ts/src/Kernel/ContentModerationStateStorageSchemaTest.php
+4
-2
core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
...oderation/tests/src/Kernel/ContentModerationStateTest.php
+11
-8
core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowConfigTest.php
.../tests/src/Kernel/ContentModerationWorkflowConfigTest.php
+4
-2
core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php
..._moderation/tests/src/Kernel/DefaultRevisionStateTest.php
+4
-2
core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php
...tent_moderation/tests/src/Kernel/EntityOperationsTest.php
+4
-2
core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php
...tion/tests/src/Kernel/EntityStateChangeValidationTest.php
+10
-8
core/modules/content_moderation/tests/src/Kernel/InitialStateTest.php
.../content_moderation/tests/src/Kernel/InitialStateTest.php
+4
-2
core/modules/content_moderation/tests/src/Kernel/ModerationInformationTest.php
...moderation/tests/src/Kernel/ModerationInformationTest.php
+4
-2
core/modules/content_moderation/tests/src/Kernel/ModerationStateFieldItemListTest.php
...ion/tests/src/Kernel/ModerationStateFieldItemListTest.php
+4
-2
core/modules/content_moderation/tests/src/Kernel/ModerationStateWidgetTest.php
...moderation/tests/src/Kernel/ModerationStateWidgetTest.php
+4
-2
core/modules/content_moderation/tests/src/Kernel/NodeAccessTest.php
...es/content_moderation/tests/src/Kernel/NodeAccessTest.php
+3
-2
core/modules/content_moderation/tests/src/Kernel/StateFormatterTest.php
...ontent_moderation/tests/src/Kernel/StateFormatterTest.php
+4
-2
core/modules/content_moderation/tests/src/Kernel/ViewsDataIntegrationTest.php
..._moderation/tests/src/Kernel/ViewsDataIntegrationTest.php
+4
-2
core/modules/content_moderation/tests/src/Kernel/ViewsModerationStateFilterTest.php
...ation/tests/src/Kernel/ViewsModerationStateFilterTest.php
+6
-3
core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php
...oderation/tests/src/Traits/ContentModerationTestTrait.php
+88
-0
core/modules/content_translation/tests/src/Functional/ContentTranslationPendingRevisionTestBase.php
.../Functional/ContentTranslationPendingRevisionTestBase.php
+3
-0
core/modules/menu_ui/tests/src/Functional/MenuUiContentModerationTest.php
...u_ui/tests/src/Functional/MenuUiContentModerationTest.php
+4
-2
core/modules/migrate_drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php
...drupal/tests/src/Kernel/d6/MigrateDrupal6AuditIdsTest.php
+3
-2
core/modules/migrate_drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php
...drupal/tests/src/Kernel/d7/MigrateDrupal7AuditIdsTest.php
+3
-2
core/modules/path/tests/src/Functional/PathContentModerationTest.php
...s/path/tests/src/Functional/PathContentModerationTest.php
+4
-2
core/profiles/standard/config/optional/workflows.workflow.editorial.yml
...standard/config/optional/workflows.workflow.editorial.yml
+0
-0
core/profiles/standard/tests/src/Functional/StandardTest.php
core/profiles/standard/tests/src/Functional/StandardTest.php
+22
-0
No files found.
core/modules/book/tests/src/Functional/BookContentModerationTest.php
View file @
34637de7
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
namespace
Drupal\Tests\book\Functional
;
namespace
Drupal\Tests\book\Functional
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\
workflows\Entity\Workflow
;
use
Drupal\
Tests\content_moderation
\
Traits\ContentModerationTestTrait
;
/**
/**
* Tests Book and Content Moderation integration.
* Tests Book and Content Moderation integration.
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
class
BookContentModerationTest
extends
BrowserTestBase
{
class
BookContentModerationTest
extends
BrowserTestBase
{
use
BookTestTrait
;
use
BookTestTrait
;
use
ContentModerationTestTrait
;
/**
/**
* Modules to install.
* Modules to install.
...
@@ -30,7 +31,7 @@ protected function setUp() {
...
@@ -30,7 +31,7 @@ protected function setUp() {
$this
->
drupalPlaceBlock
(
'system_breadcrumb_block'
);
$this
->
drupalPlaceBlock
(
'system_breadcrumb_block'
);
$this
->
drupalPlaceBlock
(
'page_title_block'
);
$this
->
drupalPlaceBlock
(
'page_title_block'
);
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'book'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'book'
);
$workflow
->
save
();
$workflow
->
save
();
...
...
core/modules/content_moderation/tests/src/Functional/ModeratedContentViewTest.php
View file @
34637de7
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
namespace
Drupal\Tests\content_moderation\Functional
;
namespace
Drupal\Tests\content_moderation\Functional
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\
workflows\Entity\Workflow
;
use
Drupal\
Tests\content_moderation
\
Traits\ContentModerationTestTrait
;
/**
/**
* Tests moderated content administration page functionality.
* Tests moderated content administration page functionality.
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
*/
*/
class
ModeratedContentViewTest
extends
BrowserTestBase
{
class
ModeratedContentViewTest
extends
BrowserTestBase
{
use
ContentModerationTestTrait
;
/**
/**
* A user with permission to bypass access content.
* A user with permission to bypass access content.
*
*
...
@@ -34,7 +36,7 @@ public function setUp() {
...
@@ -34,7 +36,7 @@ public function setUp() {
$this
->
drupalCreateContentType
([
'type'
=>
'article'
,
'name'
=>
'Article'
])
->
save
();
$this
->
drupalCreateContentType
([
'type'
=>
'article'
,
'name'
=>
'Article'
])
->
save
();
$this
->
drupalCreateContentType
([
'type'
=>
'unmoderated_type'
,
'name'
=>
'Unmoderated type'
])
->
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'
,
'page'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'article'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'article'
);
$workflow
->
save
();
$workflow
->
save
();
...
...
core/modules/content_moderation/tests/src/Functional/ModerationActionsTest.php
View file @
34637de7
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\Node
;
use
Drupal\simpletest\ContentTypeCreationTrait
;
use
Drupal\simpletest\ContentTypeCreationTrait
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\
workflows\Entity\Workflow
;
use
Drupal\
Tests\content_moderation
\
Traits\ContentModerationTestTrait
;
/**
/**
* Test the content moderation actions.
* Test the content moderation actions.
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
class
ModerationActionsTest
extends
BrowserTestBase
{
class
ModerationActionsTest
extends
BrowserTestBase
{
use
ContentTypeCreationTrait
;
use
ContentTypeCreationTrait
;
use
ContentModerationTestTrait
;
/**
/**
* Modules to enable.
* Modules to enable.
...
@@ -38,7 +39,7 @@ public function setUp() {
...
@@ -38,7 +39,7 @@ public function setUp() {
$standard_bundle
=
$this
->
createContentType
([
'type'
=>
'standard_bundle'
]);
$standard_bundle
=
$this
->
createContentType
([
'type'
=>
'standard_bundle'
]);
$standard_bundle
->
save
();
$standard_bundle
->
save
();
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'moderated_bundle'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'moderated_bundle'
);
$workflow
->
save
();
$workflow
->
save
();
...
...
core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php
View file @
34637de7
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
namespace
Drupal\Tests\content_moderation\Functional
;
namespace
Drupal\Tests\content_moderation\Functional
;
use
Drupal\Core\Entity\Entity\EntityFormDisplay
;
use
Drupal\Core\Entity\Entity\EntityFormDisplay
;
use
Drupal\workflows\Entity\Workflow
;
use
Drupal\Core\Url
;
use
Drupal\Core\Url
;
/**
/**
...
@@ -157,9 +156,8 @@ public function testModerationForm() {
...
@@ -157,9 +156,8 @@ public function testModerationForm() {
*/
*/
public
function
testNonBundleModerationForm
()
{
public
function
testNonBundleModerationForm
()
{
$this
->
drupalLogin
(
$this
->
rootUser
);
$this
->
drupalLogin
(
$this
->
rootUser
);
$workflow
=
Workflow
::
load
(
'editorial'
);
$this
->
workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test_mulrevpub'
,
'entity_test_mulrevpub'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test_mulrevpub'
,
'entity_test_mulrevpub'
);
$this
->
workflow
->
save
();
$workflow
->
save
();
// Create new moderated content in draft.
// Create new moderated content in draft.
$this
->
drupalPostForm
(
'entity_test_mulrevpub/add'
,
[
'moderation_state[0][state]'
=>
'draft'
],
t
(
'Save'
));
$this
->
drupalPostForm
(
'entity_test_mulrevpub/add'
,
[
'moderation_state[0][state]'
=>
'draft'
],
t
(
'Save'
));
...
...
core/modules/content_moderation/tests/src/Functional/ModerationRevisionRevertTest.php
View file @
34637de7
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
use
Drupal\simpletest\ContentTypeCreationTrait
;
use
Drupal\simpletest\ContentTypeCreationTrait
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\
workflows\Entity\Workflow
;
use
Drupal\
Tests\content_moderation
\
Traits\ContentModerationTestTrait
;
/**
/**
* Test revision revert.
* Test revision revert.
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
class
ModerationRevisionRevertTest
extends
BrowserTestBase
{
class
ModerationRevisionRevertTest
extends
BrowserTestBase
{
use
ContentTypeCreationTrait
;
use
ContentTypeCreationTrait
;
use
ContentModerationTestTrait
;
/**
/**
* Modules to enable.
* Modules to enable.
...
@@ -34,7 +35,7 @@ public function setUp() {
...
@@ -34,7 +35,7 @@ public function setUp() {
$moderated_bundle
=
$this
->
createContentType
([
'type'
=>
'moderated_bundle'
]);
$moderated_bundle
=
$this
->
createContentType
([
'type'
=>
'moderated_bundle'
]);
$moderated_bundle
->
save
();
$moderated_bundle
->
save
();
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'moderated_bundle'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'moderated_bundle'
);
$workflow
->
save
();
$workflow
->
save
();
...
...
core/modules/content_moderation/tests/src/Functional/ModerationStateAccessTest.php
View file @
34637de7
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\Tests\BrowserTestBase
;
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.
* Tests the view access control handler for moderation state entities.
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
*/
*/
class
ModerationStateAccessTest
extends
BrowserTestBase
{
class
ModerationStateAccessTest
extends
BrowserTestBase
{
use
ContentModerationTestTrait
;
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
...
@@ -99,7 +101,7 @@ protected function createNodeType($label, $machine_name) {
...
@@ -99,7 +101,7 @@ protected function createNodeType($label, $machine_name) {
]);
]);
$node_type
->
save
();
$node_type
->
save
();
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
$machine_name
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
$machine_name
);
$workflow
->
save
();
$workflow
->
save
();
return
$node_type
;
return
$node_type
;
...
...
core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php
View file @
34637de7
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\Tests\BrowserTestBase
;
use
Drupal\Tests\content_moderation
\
Traits\ContentModerationTestTrait
;
use
Drupal\user\Entity\Role
;
use
Drupal\user\Entity\Role
;
/**
/**
...
@@ -12,6 +13,8 @@
...
@@ -12,6 +13,8 @@
*/
*/
abstract
class
ModerationStateTestBase
extends
BrowserTestBase
{
abstract
class
ModerationStateTestBase
extends
BrowserTestBase
{
use
ContentModerationTestTrait
;
/**
/**
* Profile to use.
* Profile to use.
*
*
...
@@ -46,6 +49,13 @@ abstract class ModerationStateTestBase extends BrowserTestBase {
...
@@ -46,6 +49,13 @@ abstract class ModerationStateTestBase extends BrowserTestBase {
'use editorial transition archived_published'
,
'use editorial transition archived_published'
,
];
];
/**
* The editorial workflow entity.
*
* @var \Drupal\workflows\Entity\Workflow
*/
protected
$workflow
;
/**
/**
* Modules to enable.
* Modules to enable.
*
*
...
@@ -64,6 +74,7 @@ abstract class ModerationStateTestBase extends BrowserTestBase {
...
@@ -64,6 +74,7 @@ abstract class ModerationStateTestBase extends BrowserTestBase {
*/
*/
protected
function
setUp
()
{
protected
function
setUp
()
{
parent
::
setUp
();
parent
::
setUp
();
$this
->
workflow
=
$this
->
createEditorialWorkflow
();
$this
->
adminUser
=
$this
->
drupalCreateUser
(
$this
->
permissions
);
$this
->
adminUser
=
$this
->
drupalCreateUser
(
$this
->
permissions
);
$this
->
drupalPlaceBlock
(
'local_tasks_block'
,
[
'id'
=>
'tabs_block'
]);
$this
->
drupalPlaceBlock
(
'local_tasks_block'
,
[
'id'
=>
'tabs_block'
]);
$this
->
drupalPlaceBlock
(
'page_title_block'
);
$this
->
drupalPlaceBlock
(
'page_title_block'
);
...
...
core/modules/content_moderation/tests/src/Functional/ViewsModerationStateFilterTest.php
View file @
34637de7
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
Drupal\Tests\content_moderation\Functional
;
namespace
Drupal\Tests\content_moderation\Functional
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\Tests\content_moderation
\
Traits\ContentModerationTestTrait
;
use
Drupal\Tests\views\Functional\ViewTestBase
;
use
Drupal\Tests\views\Functional\ViewTestBase
;
use
Drupal\views\ViewExecutable
;
use
Drupal\views\ViewExecutable
;
use
Drupal\views\Views
;
use
Drupal\views\Views
;
...
@@ -17,6 +18,8 @@
...
@@ -17,6 +18,8 @@
*/
*/
class
ViewsModerationStateFilterTest
extends
ViewTestBase
{
class
ViewsModerationStateFilterTest
extends
ViewTestBase
{
use
ContentModerationTestTrait
;
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
...
@@ -45,6 +48,8 @@ protected function setUp($import_test_views = TRUE) {
...
@@ -45,6 +48,8 @@ protected function setUp($import_test_views = TRUE) {
'type'
=>
'example_b'
,
'type'
=>
'example_b'
,
])
->
save
();
])
->
save
();
$this
->
createEditorialWorkflow
();
$new_workflow
=
Workflow
::
create
([
$new_workflow
=
Workflow
::
create
([
'type'
=>
'content_moderation'
,
'type'
=>
'content_moderation'
,
'id'
=>
'new_workflow'
,
'id'
=>
'new_workflow'
,
...
...
core/modules/content_moderation/tests/src/Kernel/ContentModerationStateStorageSchemaTest.php
View file @
34637de7
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
use
Drupal\KernelTests\KernelTestBase
;
use
Drupal\KernelTests\KernelTestBase
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\
workflows\Entity\Workflow
;
use
Drupal\
Tests\content_moderation
\
Traits\ContentModerationTestTrait
;
/**
/**
* Test the ContentModerationState storage schema.
* Test the ContentModerationState storage schema.
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
*/
*/
class
ContentModerationStateStorageSchemaTest
extends
KernelTestBase
{
class
ContentModerationStateStorageSchemaTest
extends
KernelTestBase
{
use
ContentModerationTestTrait
;
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
...
@@ -45,7 +47,7 @@ protected function setUp() {
...
@@ -45,7 +47,7 @@ protected function setUp() {
NodeType
::
create
([
NodeType
::
create
([
'type'
=>
'example'
,
'type'
=>
'example'
,
])
->
save
();
])
->
save
();
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'example'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'example'
);
$workflow
->
save
();
$workflow
->
save
();
}
}
...
...
core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php
View file @
34637de7
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
use
Drupal\language\Entity\ConfigurableLanguage
;
use
Drupal\language\Entity\ConfigurableLanguage
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\Tests\content_moderation
\
Traits\ContentModerationTestTrait
;
use
Drupal\workflows\Entity\Workflow
;
use
Drupal\workflows\Entity\Workflow
;
/**
/**
...
@@ -21,6 +22,8 @@
...
@@ -21,6 +22,8 @@
*/
*/
class
ContentModerationStateTest
extends
KernelTestBase
{
class
ContentModerationStateTest
extends
KernelTestBase
{
use
ContentModerationTestTrait
;
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
...
@@ -275,7 +278,7 @@ public function testMultilingualModeration() {
...
@@ -275,7 +278,7 @@ public function testMultilingualModeration() {
]);
]);
$node_type
->
save
();
$node_type
->
save
();
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'example'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'example'
);
$workflow
->
save
();
$workflow
->
save
();
...
@@ -388,7 +391,7 @@ public function testModerationWithFieldConfigOverride() {
...
@@ -388,7 +391,7 @@ public function testModerationWithFieldConfigOverride() {
'type'
=>
'test_type'
,
'type'
=>
'test_type'
,
])
->
save
();
])
->
save
();
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'test_type'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'test_type'
);
$workflow
->
save
();
$workflow
->
save
();
...
@@ -415,7 +418,7 @@ public function testModerationWithFieldConfigOverride() {
...
@@ -415,7 +418,7 @@ public function testModerationWithFieldConfigOverride() {
* Tests that entities with special languages can be moderated.
* Tests that entities with special languages can be moderated.
*/
*/
public
function
testModerationWithSpecialLanguages
()
{
public
function
testModerationWithSpecialLanguages
()
{
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test_rev'
,
'entity_test_rev'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test_rev'
,
'entity_test_rev'
);
$workflow
->
save
();
$workflow
->
save
();
...
@@ -436,7 +439,7 @@ public function testModerationWithSpecialLanguages() {
...
@@ -436,7 +439,7 @@ public function testModerationWithSpecialLanguages() {
* Tests that a non-translatable entity type with a langcode can be moderated.
* Tests that a non-translatable entity type with a langcode can be moderated.
*/
*/
public
function
testNonTranslatableEntityTypeModeration
()
{
public
function
testNonTranslatableEntityTypeModeration
()
{
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test_rev'
,
'entity_test_rev'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test_rev'
,
'entity_test_rev'
);
$workflow
->
save
();
$workflow
->
save
();
...
@@ -470,7 +473,7 @@ public function testNonLangcodeEntityTypeModeration() {
...
@@ -470,7 +473,7 @@ public function testNonLangcodeEntityTypeModeration() {
// Update the entity type in order to remove the 'langcode' field.
// Update the entity type in order to remove the 'langcode' field.
\
Drupal
::
entityDefinitionUpdateManager
()
->
applyUpdates
();
\
Drupal
::
entityDefinitionUpdateManager
()
->
applyUpdates
();
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test_rev'
,
'entity_test_rev'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test_rev'
,
'entity_test_rev'
);
$workflow
->
save
();
$workflow
->
save
();
...
@@ -500,7 +503,7 @@ public function testWorkflowDependencies() {
...
@@ -500,7 +503,7 @@ public function testWorkflowDependencies() {
]);
]);
$node_type
->
save
();
$node_type
->
save
();
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
// Test both a config and non-config based bundle and entity type.
// Test both a config and non-config based bundle and entity type.
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'example'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'example'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test_rev'
,
'entity_test_rev'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test_rev'
,
'entity_test_rev'
);
...
@@ -543,7 +546,7 @@ public function testWorkflowNonConfigBundleDependencies() {
...
@@ -543,7 +546,7 @@ public function testWorkflowNonConfigBundleDependencies() {
// Create a bundle not based on any particular configuration.
// Create a bundle not based on any particular configuration.
entity_test_create_bundle
(
'test_bundle'
);
entity_test_create_bundle
(
'test_bundle'
);
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test'
,
'test_bundle'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'entity_test'
,
'test_bundle'
);
$workflow
->
save
();
$workflow
->
save
();
...
@@ -653,7 +656,7 @@ protected function createEntity($entity_type_id) {
...
@@ -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
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
$entity_type_id
,
$bundle_id
);
$workflow
->
save
();
$workflow
->
save
();
...
...
core/modules/content_moderation/tests/src/Kernel/ContentModerationWorkflowConfigTest.php
View file @
34637de7
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
use
Drupal\KernelTests\KernelTestBase
;
use
Drupal\KernelTests\KernelTestBase
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\NodeType
;
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.
* Tests how Content Moderation handles workflow config changes.
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
*/
*/
class
ContentModerationWorkflowConfigTest
extends
KernelTestBase
{
class
ContentModerationWorkflowConfigTest
extends
KernelTestBase
{
use
ContentModerationTestTrait
;
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
...
@@ -63,7 +65,7 @@ protected function setUp() {
...
@@ -63,7 +65,7 @@ protected function setUp() {
'type'
=>
'example'
,
'type'
=>
'example'
,
])
->
save
();
])
->
save
();
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
$workflow
->
getTypePlugin
()
->
addState
(
'test1'
,
'Test one'
)
->
addState
(
'test1'
,
'Test one'
)
->
addState
(
'test2'
,
'Test two'
)
->
addState
(
'test2'
,
'Test two'
)
...
...
core/modules/content_moderation/tests/src/Kernel/DefaultRevisionStateTest.php
View file @
34637de7
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
use
Drupal\language\Entity\ConfigurableLanguage
;
use
Drupal\language\Entity\ConfigurableLanguage
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\
workflows\Entity\Workflow
;
use
Drupal\
Tests\content_moderation
\
Traits\ContentModerationTestTrait
;
/**
/**
* Tests the correct default revision is set.
* Tests the correct default revision is set.
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
*/
*/
class
DefaultRevisionStateTest
extends
KernelTestBase
{
class
DefaultRevisionStateTest
extends
KernelTestBase
{
use
ContentModerationTestTrait
;
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*/
*/
...
@@ -68,7 +70,7 @@ public function testMultilingual() {
...
@@ -68,7 +70,7 @@ public function testMultilingual() {
$this
->
container
->
get
(
'content_translation.manager'
)
->
setEnabled
(
'node'
,
'example'
,
TRUE
);
$this
->
container
->
get
(
'content_translation.manager'
)
->
setEnabled
(
'node'
,
'example'
,
TRUE
);
$workflow
=
Workflow
::
load
(
'editorial'
);
$workflow
=
$this
->
createEditorialWorkflow
(
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'example'
);
$workflow
->
getTypePlugin
()
->
addEntityTypeAndBundle
(
'node'
,
'example'
);
$workflow
->
save
();
$workflow
->
save
();
...
...
core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php
View file @
34637de7
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
use
Drupal\KernelTests\KernelTestBase
;
use
Drupal\KernelTests\KernelTestBase
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\Node
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\node\Entity\NodeType
;
use
Drupal\
workflows\Entity\Workflow
;
use
Drupal\
Tests\content_moderation
\
Traits\ContentModerationTestTrait
;
/**
/**