only in patch2: unchanged: --- /dev/null +++ b/core/modules/user/tests/src/Functional/RoleListBuilderTest.php @@ -0,0 +1,57 @@ + 'role_1', + 'label' => 'My Role', + 'description' => 'Lorem ipsum', + ]); + $role->save(); + + // Log in as an administrator. + $admin = $this->createUser([], NULL, TRUE); + $this->drupalLogin($admin); + + $this->drupalGet('/admin/people/roles'); + + $this->assertSession()->pageTextContains('Name'); + $this->assertSession()->pageTextContains('Description'); + + // Check that the role values are displayed correctly. + $this->assertSession()->pageTextContains($role->label()); + $this->assertSession()->pageTextContains($role->getDescription()); + + } + +} only in patch2: unchanged: --- /dev/null +++ b/core/modules/user/tests/src/Functional/Update/AddUserRoleDescriptionTest.php @@ -0,0 +1,40 @@ +databaseDumpFiles = [ + __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz', + ]; + } + + /** + * Ensures description is added to user role configurations. + */ + public function testUpdate() { + $anonymous_user_role_description = \Drupal::config('user.role.anonymous')->get('description'); + $authenticated_user_role_description = \Drupal::config('user.role.authenticated')->get('description'); + $this->assertNull($anonymous_user_role_description, 'Description does not exist for anonymous user role.'); + $this->assertNull($authenticated_user_role_description, 'Description does not exist for authenticated user role.'); + + $this->runUpdates(); + + $anonymous_user_role_description = \Drupal::config('user.role.anonymous')->get('description'); + $authenticated_user_role_description = \Drupal::config('user.role.authenticated')->get('description'); + $this->assertEquals('The role given to users that are not logged in.', $anonymous_user_role_description, 'Description has been added for anonymous user role.'); + $this->assertEquals('The basic role given to logged in users.', $authenticated_user_role_description, 'Description has been added for authenticated user role.'); + } + +}