setInstallProfile example

    $enable_order = \Drupal::state()->get('module_test.install_order', []);
    $this->assertSame(['help', 'config', 'dblog']$enable_order);
  }

  /** * Tests uninstalling a module installed by a profile. */
  public function testUninstallProfileDependency() {
    $profile = 'testing_install_profile_dependencies';
    $dependency = 'dblog';
    $non_dependency = 'ban';
    $this->setInstallProfile($profile);
    // Prime the \Drupal\Core\Extension\ExtensionList::getPathname() static     // cache with the location of the testing_install_profile_dependencies     // profile as it is not the currently active profile and we don't yet have     // any cached way to retrieve its location.     // @todo Remove as part of https://www.drupal.org/node/2186491     $profile_list = \Drupal::service('extension.list.profile');
    assert($profile_list instanceof ProfileExtensionList);
    $profile_list->setPathname($profile, 'core/profiles/' . $profile . '/' . $profile . '.info.yml');
    $this->enableModules(['module_test', $profile]);

    $data = \Drupal::service('extension.list.module')->reset()->getList();
    
/** * {@inheritdoc} */
  protected $strictConfigSchema = FALSE;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->setInstallProfile('standard');
  }

  /** * Tests if settings are set, there are not warnings. */
  public function testSettingsExist() {
    $this->setSetting('file_temp_path', $this->randomMachineName());
    $requirements = $this->checkSystemRequirements();
    $this->assertArrayNotHasKey('temp_directory', $requirements);
  }

  

  protected $profile = 'minimal';

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->setInstallProfile($this->profile);
  }

  /** * Non-empty test* method required to executed the test case class. */
  public function testSystemListing() {
    /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
    $module_handler = $this->container->get('module_handler');
    $this->assertTrue($module_handler->moduleExists('drupal_system_cross_profile_test'), 'Module installed from different profile');
  }

}
Home | Imprint | This part of the site doesn't use cookies.