Pull merge.
[yaffs-website] / web / core / tests / Drupal / FunctionalTests / Installer / InstallProfileDependenciesBcTest.php
1 <?php
2
3 namespace Drupal\FunctionalTests\Installer;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Tests that an install profile with only dependencies works as expected.
9  *
10  * @group Installer
11  * @group legacy
12  */
13 class InstallProfileDependenciesBcTest extends BrowserTestBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   protected $profile = 'testing_install_profile_dependencies_bc';
19
20   /**
21    * Tests that the install profile BC layer for dependencies key works.
22    *
23    * @expectedDeprecation The install profile core/profiles/testing_install_profile_dependencies_bc/testing_install_profile_dependencies_bc.info.yml only implements a 'dependencies' key. As of Drupal 8.6.0 profile's support a new 'install' key for modules that should be installed but not depended on. See https://www.drupal.org/node/2952947.
24    */
25   public function testUninstallingModules() {
26     $user = $this->drupalCreateUser(['administer modules']);
27     $this->drupalLogin($user);
28     $this->drupalGet('admin/modules/uninstall');
29     $this->getSession()->getPage()->checkField('uninstall[ban]');
30     $this->getSession()->getPage()->checkField('uninstall[dblog]');
31     $this->click('#edit-submit');
32     // Click the confirm button.
33     $this->click('#edit-submit');
34     $this->assertSession()->responseContains('The selected modules have been uninstalled.');
35     $this->assertSession()->responseContains('No modules are available to uninstall.');
36     // We've uninstalled modules therefore we need to rebuild the container in
37     // the test runner.
38     $this->rebuildContainer();
39     $module_handler = $this->container->get('module_handler');
40     $this->assertFalse($module_handler->moduleExists('ban'));
41     $this->assertFalse($module_handler->moduleExists('dblog'));
42   }
43
44 }