class UserBatchActionTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Functional/UserBatchActionTest.php \Drupal\Tests\views\Functional\UserBatchActionTest
- 9 core/modules/views/tests/src/Functional/UserBatchActionTest.php \Drupal\Tests\views\Functional\UserBatchActionTest
Tests the views bulk form with batch action.
@group action
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\views\Functional\UserBatchActionTest
Expanded class hierarchy of UserBatchActionTest
See also
\Drupal\action\Plugin\views\field\BulkForm
File
- core/
modules/ views/ tests/ src/ Functional/ UserBatchActionTest.php, line 13
Namespace
Drupal\Tests\views\FunctionalView source
class UserBatchActionTest extends BrowserTestBase {
/**
* Modules to install.
*
* @var array
*/
protected static $modules = [
// @todo Remove this in https://www.drupal.org/node/3219959
'block',
'user',
'user_batch_action_test',
'views',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests user admin batch.
*/
public function testUserAction() {
$themes = [
'classy',
'olivero',
'claro',
];
$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
->submitForm($edit, 'Apply');
$this
->assertSession()
->pageTextContains('One item has been processed.');
$this
->assertSession()
->pageTextContains($theme . ' theme used');
}
}
}