ActionUninstallTest.php in Drupal 9
File
core/modules/action/tests/src/Functional/ActionUninstallTest.php
View source
<?php
namespace Drupal\Tests\action\Functional;
use Drupal\Tests\BrowserTestBase;
class ActionUninstallTest extends BrowserTestBase {
protected static $modules = [
'views',
'action',
];
protected $defaultTheme = 'stark';
public function testActionUninstall() {
\Drupal::service('module_installer')
->uninstall([
'action',
]);
$storage = $this->container
->get('entity_type.manager')
->getStorage('action');
$storage
->resetCache([
'user_block_user_action',
]);
$this
->assertNotEmpty($storage
->load('user_block_user_action'), 'Configuration entity \'user_block_user_action\' still exists after uninstalling action module.');
$admin_user = $this
->drupalCreateUser([
'administer users',
]);
$this
->drupalLogin($admin_user);
$this
->drupalGet('admin/people');
$this
->assertSession()
->responseContains('<option value="user_block_user_action">Block the selected user(s)</option>');
}
}