class InstallProfileDependenciesTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesTest.php \Drupal\FunctionalTests\Installer\InstallProfileDependenciesTest
- 10 core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesTest.php \Drupal\FunctionalTests\Installer\InstallProfileDependenciesTest
- 8.9.x core/tests/Drupal/FunctionalTests/Installer/InstallProfileDependenciesTest.php \Drupal\FunctionalTests\Installer\InstallProfileDependenciesTest
Tests that an install profile can require modules.
@group Installer
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalTests\Installer\InstallProfileDependenciesTest extends \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of InstallProfileDependenciesTest
File
-
core/
tests/ Drupal/ FunctionalTests/ Installer/ InstallProfileDependenciesTest.php, line 13
Namespace
Drupal\FunctionalTests\InstallerView source
class InstallProfileDependenciesTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected $profile = 'testing_install_profile_dependencies';
/**
* Tests that an install profile can require modules.
*/
public function testUninstallingModules() {
$user = $this->drupalCreateUser([
'administer modules',
]);
$this->drupalLogin($user);
$this->drupalGet('admin/modules/uninstall');
$this->assertSession()
->fieldDisabled('uninstall[dblog]');
$this->getSession()
->getPage()
->checkField('uninstall[ban]');
$this->click('#edit-submit');
// Click the confirm button.
$this->click('#edit-submit');
$this->assertSession()
->responseContains('The selected modules have been uninstalled.');
// We've uninstalled a module therefore we need to rebuild the container in
// the test runner.
$this->rebuildContainer();
$this->assertFalse($this->container
->get('module_handler')
->moduleExists('ban'));
try {
$this->container
->get('module_installer')
->uninstall([
'dblog',
]);
$this->fail('Uninstalled dblog module.');
} catch (ModuleUninstallValidatorException $e) {
$this->assertStringContainsString('The Testing install profile dependencies module is required', $e->getMessage());
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.