function MigrateUserRoleTest::providerTestUserRole

Same name in other branches
  1. 11.x core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserRoleTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateUserRoleTest::providerTestUserRole()

Data provider for user role migration tests.

File

core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserRoleTest.php, line 105

Class

MigrateUserRoleTest
Upgrade user roles to user.role.*.yml.

Namespace

Drupal\Tests\user\Kernel\Migrate\d6

Code

public static function providerTestUserRole() {
    return [
        'filter only' => [
            'modules' => [],
            'migrations' => [
                'd6_filter_format',
                'd6_user_role',
            ],
            'role_data' => [
                'anonymous' => [
                    'rid' => 1,
                    'valid' => [
                        'access content',
                        'use text format filtered_html',
                    ],
                    'invalid' => [
                        'migrate test anonymous permission',
                    ],
                ],
                'authenticated' => [
                    'rid' => 2,
                    'valid' => [
                        'access content',
                        'use text format filtered_html',
                    ],
                    'invalid' => [
                        'access comments',
                        'migrate test authenticated permission',
                        'post comments',
                        'skip comment approval',
                    ],
                ],
                'migrate_test_role_1' => [
                    'rid' => 3,
                    'valid' => [
                        'use text format full_html',
                        'use text format php_code',
                    ],
                    'invalid' => [
                        'migrate test role 1 test permission',
                    ],
                ],
                'migrate_test_role_2' => [
                    'rid' => 4,
                    'valid' => [
                        'access content overview',
                        'administer nodes',
                        'use text format php_code',
                    ],
                    'invalid' => [
                        'administer contact forms',
                        'create forum content',
                        'delete any blog content',
                        'delete any forum content',
                        'delete own blog content',
                        'delete own forum content',
                        'edit any blog content',
                        'edit any forum content',
                        'edit own blog content',
                        'edit own forum content',
                        'migrate test role 2 test permission',
                        'skip comment approval',
                        'use PHP for settings',
                    ],
                ],
                'migrate_test_role_3_that_is_longer_than_thirty_two_characters' => [
                    'rid' => 5,
                    'valid' => [
                        'use text format php_code',
                    ],
                    'invalid' => [],
                ],
            ],
        ],
        'all dependent migrations' => [
            'modules' => [
                'block',
                'block_content',
                'comment',
                'contact',
                'config_translation',
                'language',
                'link',
                'menu_ui',
                'node',
                'taxonomy',
                'text',
            ],
            'migrations' => [
                'language',
                'd6_comment_type',
                'block_content_type',
                'contact_category',
                'd6_filter_format',
                'd6_taxonomy_vocabulary',
                'd6_taxonomy_vocabulary_translation',
                'd6_user_role',
            ],
            'role_data' => [
                'anonymous' => [
                    'rid' => 1,
                    'valid' => [
                        'access content',
                        'use text format filtered_html',
                    ],
                    'invalid' => [
                        'migrate test anonymous permission',
                    ],
                ],
                'authenticated' => [
                    'rid' => 2,
                    'valid' => [
                        'access comments',
                        'access content',
                        'post comments',
                        'skip comment approval',
                        'use text format filtered_html',
                    ],
                    'invalid' => [
                        'migrate test authenticated permission',
                    ],
                ],
                'migrate_test_role_1' => [
                    'rid' => 3,
                    'valid' => [
                        'use text format full_html',
                        'use text format php_code',
                    ],
                    'invalid' => [
                        'migrate test role 1 test permission',
                    ],
                ],
                'migrate_test_role_2' => [
                    'rid' => 4,
                    'valid' => [
                        'access content overview',
                        'administer contact forms',
                        'administer nodes',
                        'create forum content',
                        'delete any forum content',
                        'delete own forum content',
                        'edit any forum content',
                        'edit own forum content',
                        'skip comment approval',
                        'use text format php_code',
                    ],
                    'invalid' => [
                        'delete any blog content',
                        'delete own blog content',
                        'edit any blog content',
                        'edit own blog content',
                        'migrate test role 2 test permission',
                        'use PHP for settings',
                    ],
                ],
                'migrate_test_role_3_that_is_longer_than_thirty_two_characters' => [
                    'rid' => 5,
                    'valid' => [
                        'use text format php_code',
                    ],
                    'invalid' => [],
                ],
            ],
        ],
    ];
}

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