ProfileAutoUninstallTest.php

Same filename and directory in other branches
  1. main core/tests/Drupal/FunctionalTests/Installer/ProfileAutoUninstallTest.php

Namespace

Drupal\FunctionalTests\Installer

File

core/tests/Drupal/FunctionalTests/Installer/ProfileAutoUninstallTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\FunctionalTests\Installer;

use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
 * Tests automatically uninstalling a profile that opts into it.
 */
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);
  }

}

Classes

Title Deprecated Summary
ProfileAutoUninstallTest Tests automatically uninstalling a profile that opts into it.

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