You are here

public function ClassyUninstallUpdateTest::testUpdateClassyNeeded in Drupal 9

Ensures that updates run without errors when Classy is still needed.

File

core/modules/system/tests/src/Functional/Update/ClassyUninstallUpdateTest.php, line 74

Class

ClassyUninstallUpdateTest
Ensures that update hook uninstalls Classy when it's no longer needed.

Namespace

Drupal\Tests\system\Functional\Update

Code

public function testUpdateClassyNeeded() {

  /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */
  $theme_handler = $this->container
    ->get('theme_handler');

  /** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
  $theme_installer = $this->container
    ->get('theme_installer');
  $theme_installer
    ->install([
    'test_theme',
  ]);
  $this
    ->assertTrue($theme_handler
    ->themeExists('classy'));
  $this
    ->runUpdates();

  // Ensure that Classy is still installed after running tests.
  $theme_handler
    ->refreshInfo();
  $this
    ->assertTrue($theme_handler
    ->themeExists('classy'));
}