function ThemeUninstallConfirmTest::testConfigDependenciesDisplayed

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/src/Functional/Theme/ThemeUninstallConfirmTest.php \Drupal\Tests\system\Functional\Theme\ThemeUninstallConfirmTest::testConfigDependenciesDisplayed()

Tests that configuration dependencies are displayed.

File

core/modules/system/tests/src/Functional/Theme/ThemeUninstallConfirmTest.php, line 120

Class

ThemeUninstallConfirmTest
Tests the theme uninstall confirmation form.

Namespace

Drupal\Tests\system\Functional\Theme

Code

public function testConfigDependenciesDisplayed() : void {
  \Drupal::service('theme_installer')->install([
    'claro',
  ]);
  $this->drupalPlaceBlock('system_powered_by_block', [
    'region' => 'content',
    'theme' => 'claro',
    'id' => 'claro_powered_by',
    'label' => 'Powered by Claro',
  ]);
  $this->drupalGet('admin/appearance/uninstall', [
    'query' => [
      'theme' => 'claro',
    ],
  ]);
  $this->assertSession()
    ->pageTextContains('Configuration deletions');
  $this->assertSession()
    ->pageTextContains('Powered by Claro');
  $this->submitForm([], 'Uninstall');
  $this->assertSession()
    ->pageTextContains('The Claro theme has been uninstalled');
  $block = \Drupal::entityTypeManager()->getStorage('block')
    ->load('claro_powered_by');
  $this->assertNull($block, 'Block config was deleted');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.