You are here

public function ClassyUninstallUpdateTest::testUpdate in Drupal 9

Ensures that Classy is disabled if it's no longer needed.

File

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

Class

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

Namespace

Drupal\Tests\system\Functional\Update

Code

public function testUpdate() {

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

  // Ensure that Classy is not installed after running updates.
  $theme_handler
    ->refreshInfo();
  $this
    ->assertFalse($theme_handler
    ->themeExists('classy'));
  $this
    ->assertTrue($theme_handler
    ->themeExists('seven'));
}