diff --git a/core/modules/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php b/core/modules/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php index a546554..d55c4b1 100644 --- a/core/modules/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php +++ b/core/modules/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php @@ -57,7 +57,7 @@ protected function getEntityCounts() { 'search_page' => 2, 'shortcut' => 6, 'shortcut_set' => 2, - 'action' => 18, + 'action' => 14, 'menu' => 10, 'taxonomy_term' => 18, 'taxonomy_vocabulary' => 3, diff --git a/core/modules/user/src/Tests/Views/BulkFormTest.php b/core/modules/user/src/Tests/Views/BulkFormTest.php index b00cc95..43e4ec1 100644 --- a/core/modules/user/src/Tests/Views/BulkFormTest.php +++ b/core/modules/user/src/Tests/Views/BulkFormTest.php @@ -7,6 +7,7 @@ namespace Drupal\user\Tests\Views; +use Drupal\system\Entity\Action; use Drupal\user\RoleInterface; use Drupal\views\Views; @@ -42,6 +43,35 @@ public function testBulkForm() { // Create an user which actually can change users. $this->drupalLogin($this->drupalCreateUser(array('administer users'))); + + // Assign a role to a user. + $account = $user_storage->load($this->users[0]->id()); + $roles = user_role_names(TRUE); + unset($roles[RoleInterface::AUTHENTICATED_ID]); + $role = key($roles); + + // Add actions. + $action = Action::create(array( + 'id' => 'user_add_role_action.' . $role, + 'type' => 'user', + 'label' => t('Add the @label role to the selected users', array('@label' => $role)), + 'configuration' => array( + 'rid' => $role, + ), + 'plugin' => 'user_add_role_action', + )); + $action->trustData()->save(); + $action = Action::create(array( + 'id' => 'user_remove_role_action.' . $role, + 'type' => 'user', + 'label' => t('Remove the @label role from the selected users', array('@label' => $role)), + 'configuration' => array( + 'rid' => $role, + ), + 'plugin' => 'user_remove_role_action', + )); + $action->trustData()->save(); + $this->drupalGet('test-user-bulk-form'); $result = $this->cssSelect('#edit-action option'); $this->assertTrue(count($result) > 0); @@ -53,12 +83,6 @@ public function testBulkForm() { $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply')); $this->assertText(t('No users selected.')); - // Assign a role to a user. - $account = $user_storage->load($this->users[0]->id()); - $roles = user_role_names(TRUE); - unset($roles[RoleInterface::AUTHENTICATED_ID]); - $role = key($roles); - $this->assertFalse($account->hasRole($role), 'The user currently does not have a custom role.'); $edit = array( 'user_bulk_form[1]' => TRUE,