setUpProfile example

$this->markTestSkipped('Skipped due to frequent random test failures.');
    parent::setUp();
  }

  /** * Installer step: Select installation profile. */
  protected function setUpProfile() {
    // Ensure the site name 'Multilingual' appears as expected in the 'Use     // existing configuration' radio description.     $this->assertSession()->pageTextContains('Install Multilingual using existing configuration.');
    return parent::setUpProfile();
  }

  /** * {@inheritdoc} */
  protected function getConfigTarball() {
    return __DIR__ . '/../../../fixtures/config_install/multilingual.tar.gz';
  }

  /** * {@inheritdoc} */
/** * Installer step: Select installation profile. */
  protected function setUpProfile() {
    if ($this->existingSyncDirectory) {
      $edit = [
        'profile' => SelectProfileForm::CONFIG_INSTALL_PROFILE_KEY,
      ];
      $this->submitForm($edit$this->translations['Save and continue']);
    }
    else {
      parent::setUpProfile();
    }
  }

}

  public function testInstaller() {
    // Verify that Drupal can't be immediately reinstalled.     $this->visitInstaller();
    $this->assertSession()->pageTextContains('Drupal already installed');

    // Delete settings.php and attempt to reinstall again.     unlink($this->siteDirectory . '/settings.php');
    $this->visitInstaller();
    $this->setUpLanguage();
    $this->setUpProfile();
    $this->setUpRequirementsProblem();
    $this->setUpSettings();
    $this->assertSession()->pageTextContains('Drupal already installed');
  }

}
protected function setUpProfile() {
    $settings_services_file = DRUPAL_ROOT . '/sites/default/default.services.yml';
    // Copy the testing-specific service overrides in place.     copy($settings_services_file$this->siteDirectory . '/services.yml');
    PerformanceTestRecorder::registerService($this->siteDirectory . '/services.yml', TRUE);
    // Assert that the expected title is present.     $this->assertEquals('Select an installation profile', $this->cssSelect('main h2')[0]->getText());
    // Verify that Title/Label are not displayed when '#title_display' =>     // 'invisible' attribute is set.     $this->assertSession()->elementsCount('xpath', "//span[contains(@class, 'visually-hidden') and contains(text(), 'Select an installation profile')]", 1);

    parent::setUpProfile();
  }

  /** * {@inheritdoc} */
  protected function setUpSettings() {
    // Assert that the expected title is present.     $this->assertEquals('Database configuration', $this->cssSelect('main h2')[0]->getText());

    // Assert that we use the by core supported database drivers by default and     // not the ones from the driver_test module.
    $this->initMink();

    // Set up the browser test output file.     $this->initBrowserOutputFile();

    $this->visitInstaller();

    // Select language.     $this->setUpLanguage();

    // Select profile.     $this->setUpProfile();

    // Address the requirements problem screen, if any.     $this->setUpRequirementsProblem();

    // Configure settings.     $this->setUpSettings();

    // @todo Allow test classes based on this class to act on further installer     // screens.
    // Configure site.
Home | Imprint | This part of the site doesn't use cookies.