Mercurial > hg > isophonics-drupal-site
comparison core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesTest.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 |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\FunctionalTests\Installer; | |
4 | |
5 use Drupal\Core\Extension\ModuleUninstallValidatorException; | |
6 use Drupal\Tests\BrowserTestBase; | |
7 | |
8 /** | |
9 * Tests that an install profile can require modules. | |
10 * | |
11 * @group Installer | |
12 */ | |
13 class InstallProfileDependenciesTest extends BrowserTestBase { | |
14 | |
15 /** | |
16 * {@inheritdoc} | |
17 */ | |
18 protected $profile = 'testing_install_profile_dependencies'; | |
19 | |
20 /** | |
21 * Tests that an install profile can require modules. | |
22 */ | |
23 public function testUninstallingModules() { | |
24 $user = $this->drupalCreateUser(['administer modules']); | |
25 $this->drupalLogin($user); | |
26 $this->drupalGet('admin/modules/uninstall'); | |
27 $this->assertSession()->fieldDisabled('uninstall[dblog]'); | |
28 $this->getSession()->getPage()->checkField('uninstall[ban]'); | |
29 $this->click('#edit-submit'); | |
30 // Click the confirm button. | |
31 $this->click('#edit-submit'); | |
32 $this->assertSession()->responseContains('The selected modules have been uninstalled.'); | |
33 // We've uninstalled a module therefore we need to rebuild the container in | |
34 // the test runner. | |
35 $this->rebuildContainer(); | |
36 $this->assertFalse($this->container->get('module_handler')->moduleExists('ban')); | |
37 try { | |
38 $this->container->get('module_installer')->uninstall(['dblog']); | |
39 $this->fail('Uninstalled dblog module.'); | |
40 } | |
41 catch (ModuleUninstallValidatorException $e) { | |
42 $this->assertContains('The Testing install profile dependencies module is required', $e->getMessage()); | |
43 } | |
44 } | |
45 | |
46 } |