diff core/modules/views/tests/src/Functional/UserBatchActionTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/modules/views/tests/src/Functional/UserBatchActionTest.php	Thu Feb 28 13:21:36 2019 +0000
@@ -0,0 +1,44 @@
+<?php
+
+namespace Drupal\Tests\views\Functional;
+
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Tests the views bulk form with batch action.
+ *
+ * @group action
+ * @see \Drupal\action\Plugin\views\field\BulkForm
+ */
+class UserBatchActionTest extends BrowserTestBase {
+
+  /**
+   * Modules to install.
+   *
+   * @var array
+   */
+  public static $modules = ['user', 'user_batch_action_test', 'views'];
+
+  /**
+   * Tests user admin batch.
+   */
+  public function testUserAction() {
+    $themes = ['classy', 'seven', 'bartik', 'test_subseven'];
+    $this->container->get('theme_installer')->install($themes);
+
+    $this->drupalLogin($this->rootUser);
+
+    foreach ($themes as $theme) {
+      $this->config('system.theme')->set('default', $theme)->save();
+      $this->drupalGet('admin/people');
+      $edit = [
+        'user_bulk_form[0]' => TRUE,
+        'action' => 'user_batch_action_test_action',
+      ];
+      $this->drupalPostForm(NULL, $edit, t('Apply'));
+      $this->assertSession()->pageTextContains('One item has been processed.');
+      $this->assertSession()->pageTextContains($theme . ' theme used');
+    }
+  }
+
+}