comparison core/modules/action/tests/src/Functional/ActionUninstallTest.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children af1871eacc83
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\Tests\action\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8 * Tests that uninstalling actions does not remove other module's actions.
9 *
10 * @group action
11 * @see \Drupal\action\Plugin\views\field\BulkForm
12 */
13 class ActionUninstallTest extends BrowserTestBase {
14
15 /**
16 * Modules to install.
17 *
18 * @var array
19 */
20 public static $modules = ['views', 'action'];
21
22 /**
23 * Tests Action uninstall.
24 */
25 public function testActionUninstall() {
26 \Drupal::service('module_installer')->uninstall(['action']);
27
28 $storage = $this->container->get('entity_type.manager')->getStorage('action');
29 $storage->resetCache(['user_block_user_action']);
30 $this->assertTrue($storage->load('user_block_user_action'), 'Configuration entity \'user_block_user_action\' still exists after uninstalling action module.');
31
32 $admin_user = $this->drupalCreateUser(['administer users']);
33 $this->drupalLogin($admin_user);
34
35 $this->drupalGet('admin/people');
36 // Ensure we have the user_block_user_action listed.
37 $this->assertRaw('<option value="user_block_user_action">Block the selected user(s)</option>');
38
39 }
40
41 }