class ProfileAutoUninstallTest

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/FunctionalTests/Installer/ProfileAutoUninstallTest.php \Drupal\FunctionalTests\Installer\ProfileAutoUninstallTest

Tests automatically uninstalling a profile that opts into it.

Attributes

#[Group('Installer')] #[RunTestsInSeparateProcesses]

Hierarchy

Expanded class hierarchy of ProfileAutoUninstallTest

File

core/tests/Drupal/FunctionalTests/Installer/ProfileAutoUninstallTest.php, line 13

Namespace

Drupal\FunctionalTests\Installer
View source
class ProfileAutoUninstallTest extends InstallerTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected $profile = 'testing_auto_uninstall';
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  
  /**
   * Tests that the profile was automatically uninstalled.
   */
  public function testAutomaticUninstall() : void {
    // The profile included no in-use dependencies, and therefore should
    // have been successfully uninstalled.
    $extensions = $this->config('core.extension')
      ->get();
    $this->assertArrayNotHasKey($this->profile, $extensions['module']);
    $this->assertArrayNotHasKey('profile', $extensions);
  }

}

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