function MigrateUserRoleTest::assertNoDuplicateRoles

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

Asserts there are no duplicate roles.

1 call to MigrateUserRoleTest::assertNoDuplicateRoles()
MigrateUserRoleTest::testUserRole in core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserRoleTest.php
Tests user role migration.

File

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

Class

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

Namespace

Drupal\Tests\user\Kernel\Migrate\d6

Code

public function assertNoDuplicateRoles() {
    $roles = [
        'anonymous1',
        'authenticated1',
        'administrator1',
        'migrate_test_role_11',
        'migrate_test_role_21',
        'migrate_test_role_3_that_is_longer_than_thirty_two_characters1',
        'migrate_test_role_41',
    ];
    $this->assertEmpty(Role::loadMultiple($roles));
}

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