function ContentModerationPermissionsTest::permissionsTestCases

Same name in other branches
  1. 9 core/modules/content_moderation/tests/src/Kernel/ContentModerationPermissionsTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationPermissionsTest::permissionsTestCases()
  2. 10 core/modules/content_moderation/tests/src/Kernel/ContentModerationPermissionsTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationPermissionsTest::permissionsTestCases()
  3. 11.x core/modules/content_moderation/tests/src/Kernel/ContentModerationPermissionsTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationPermissionsTest::permissionsTestCases()

Test cases for ::testPermissions

Return value

array Content moderation permissions based test cases.

File

core/modules/content_moderation/tests/src/Kernel/ContentModerationPermissionsTest.php, line 51

Class

ContentModerationPermissionsTest
Test to ensure content moderation permissions are generated correctly.

Namespace

Drupal\Tests\content_moderation\Kernel

Code

public function permissionsTestCases() {
    return [
        'Simple Content Moderation Workflow' => [
            [
                'id' => 'simple_workflow',
                'label' => 'Simple Workflow',
                'type' => 'content_moderation',
            ],
            [
                'use simple_workflow transition publish' => [
                    'title' => '<em class="placeholder">Simple Workflow</em> workflow: Use <em class="placeholder">Publish</em> transition.',
                ],
                'use simple_workflow transition create_new_draft' => [
                    'title' => '<em class="placeholder">Simple Workflow</em> workflow: Use <em class="placeholder">Create New Draft</em> transition.',
                ],
            ],
        ],
        'Non Content Moderation Workflow' => [
            [
                'id' => 'morning',
                'label' => 'Morning',
                'type' => 'workflow_type_test',
                'transitions' => [
                    'drink_coffee' => [
                        'label' => 'Drink Coffee',
                        'from' => [
                            'tired',
                        ],
                        'to' => 'awake',
                        'weight' => 0,
                    ],
                ],
                'states' => [
                    'awake' => [
                        'label' => 'Awake',
                        'weight' => -5,
                    ],
                    'tired' => [
                        'label' => 'Tired',
                        'weight' => -0,
                    ],
                ],
            ],
            [],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.