function ThemeUninstallConfirmTest::testThemeUninstallConfirmForm
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/Theme/ThemeUninstallConfirmTest.php \Drupal\Tests\system\Functional\Theme\ThemeUninstallConfirmTest::testThemeUninstallConfirmForm()
Tests the theme uninstall confirmation form basic workflow.
File
-
core/
modules/ system/ tests/ src/ Functional/ Theme/ ThemeUninstallConfirmTest.php, line 46
Class
- ThemeUninstallConfirmTest
- Tests the theme uninstall confirmation form.
Namespace
Drupal\Tests\system\Functional\ThemeCode
public function testThemeUninstallConfirmForm() : void {
\Drupal::service('theme_installer')->install([
'default_admin',
]);
$this->drupalGet('admin/appearance');
$this->clickLink('Uninstall Default Admin theme');
$this->drupalGet('admin/appearance/uninstall', [
'query' => [
'theme' => 'default_admin',
],
]);
$this->assertSession()
->pageTextContains('Uninstall Default Admin theme');
$this->assertSession()
->pageTextContains('The Default Admin theme will be completely uninstalled from your site, and all data from this theme will be lost!');
$this->assertSession()
->buttonExists('Uninstall');
$this->assertSession()
->linkExists('Cancel');
$this->submitForm([], 'Uninstall');
$this->assertSession()
->pageTextContains('The Default Admin theme has been uninstalled');
$this->assertSession()
->addressEquals('admin/appearance');
$this->assertSession()
->linkExists('Install Default Admin theme');
\Drupal::service('theme_handler')->refreshInfo();
$themes = \Drupal::service('theme_handler')->listInfo();
$this->assertArrayNotHasKey('default_admin', $themes);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.