annotate core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesBcTest.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 129ea1e6d783
children
rev   line source
Chris@17 1 <?php
Chris@17 2
Chris@17 3 namespace Drupal\FunctionalTests\Installer;
Chris@17 4
Chris@17 5 use Drupal\Tests\BrowserTestBase;
Chris@17 6
Chris@17 7 /**
Chris@17 8 * Tests that an install profile with only dependencies works as expected.
Chris@17 9 *
Chris@17 10 * @group Installer
Chris@17 11 * @group legacy
Chris@17 12 */
Chris@17 13 class InstallProfileDependenciesBcTest extends BrowserTestBase {
Chris@17 14
Chris@17 15 /**
Chris@17 16 * {@inheritdoc}
Chris@17 17 */
Chris@17 18 protected $profile = 'testing_install_profile_dependencies_bc';
Chris@17 19
Chris@17 20 /**
Chris@17 21 * Tests that the install profile BC layer for dependencies key works.
Chris@17 22 *
Chris@17 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.
Chris@17 24 */
Chris@17 25 public function testUninstallingModules() {
Chris@17 26 $user = $this->drupalCreateUser(['administer modules']);
Chris@17 27 $this->drupalLogin($user);
Chris@17 28 $this->drupalGet('admin/modules/uninstall');
Chris@17 29 $this->getSession()->getPage()->checkField('uninstall[ban]');
Chris@17 30 $this->getSession()->getPage()->checkField('uninstall[dblog]');
Chris@17 31 $this->click('#edit-submit');
Chris@17 32 // Click the confirm button.
Chris@17 33 $this->click('#edit-submit');
Chris@17 34 $this->assertSession()->responseContains('The selected modules have been uninstalled.');
Chris@17 35 $this->assertSession()->responseContains('No modules are available to uninstall.');
Chris@17 36 // We've uninstalled modules therefore we need to rebuild the container in
Chris@17 37 // the test runner.
Chris@17 38 $this->rebuildContainer();
Chris@17 39 $module_handler = $this->container->get('module_handler');
Chris@17 40 $this->assertFalse($module_handler->moduleExists('ban'));
Chris@17 41 $this->assertFalse($module_handler->moduleExists('dblog'));
Chris@17 42 }
Chris@17 43
Chris@17 44 }