public function UserRoleUpgradePathTest::testRoleUpgradeToConfig

Tests that roles were converted to config.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/UserRoleUpgradePathTest.php, line 82
Definition of Drupal\system\Tests\Upgrade\UserRoleUpgradePathTest.

Class

UserRoleUpgradePathTest
Tests upgrading a bare database with user role data.

Namespace

Drupal\system\Tests\Upgrade

Code

public function testRoleUpgradeToConfig() {
  $this
    ->assertTrue($this
    ->performUpgrade(), 'The upgrade was completed successfully.');

  // Check that the 'anonymous' role has been converted to config.
  $anonymous = entity_load('user_role', DRUPAL_ANONYMOUS_RID);
  $this
    ->assertNotEqual(FALSE, $anonymous, "The 'anonymous' role has been converted to config.");

  // Check that the 'authenticated' role has been converted to config.
  $authenticated = entity_load('user_role', DRUPAL_AUTHENTICATED_RID);
  $this
    ->assertNotEqual(FALSE, $authenticated, "The 'authenticated' role has been converted to config.");
}