prepareSettings example

$this->prepareEnvironment();
    $this->executePreinstallClass($setup_class);
    $this->installDrupal();
    $this->executeSetupClass($setup_class);
  }

  /** * Installs Drupal into the test site. */
  protected function installDrupal() {
    $this->initUserSession();
    $this->prepareSettings();
    $this->doInstall();
    $this->initSettings();
    $container = $this->initKernel(\Drupal::request());
    $this->initConfig($container);
  }

  /** * Uses the setup file to configure Drupal. * * @param string $class * The fully qualified class name, which should set up Drupal for tests. For * example this class could create content types and fields or install * modules. The class needs to implement TestSetupInterface. * * @see \Drupal\TestSite\TestSetupInterface */
use RequirementsPageTrait;

  /** * {@inheritdoc} */
  protected $profile = 'theme_test_profile';

  /** * {@inheritdoc} */
  protected function prepareSettings() {
    parent::prepareSettings();
    $this->writeSettings([
      'settings' => [
        'maintenance_theme' => (object) [
          'value' => 'test_theme_updates',
          'required' => TRUE,
        ],
      ],
    ]);
  }

  /** * {@inheritdoc} */
$value = $option->getAttribute('value') ?: $label;
      $options[$value] = $label;
    }
    return $options;
  }

  /** * Installs Drupal into the test site. */
  public function installDrupal() {
    $this->initUserSession();
    $this->prepareSettings();
    $this->doInstall();
    $this->initSettings();
    $this->container = $container = $this->initKernel(\Drupal::request());
    $this->initConfig($container);
    $this->installDefaultThemeFromClassProperty($container);
    $this->installModulesFromClassProperty($container);

    // Clear the static cache so that subsequent cache invalidations will work     // as expected.     $this->container->get('cache_tags.invalidator')->resetChecksums();

    
protected $defaultTheme = 'stark';

  /** * {@inheritdoc} */
  protected $profile = 'testing';

  /** * {@inheritdoc} */
  protected function prepareSettings() {
    parent::prepareSettings();
    PerformanceTestRecorder::registerService($this->siteDirectory . '/services.yml', FALSE);
  }

  /** * Ensures that the user page is available after installation. */
  public function testInstaller() {
    // Ensures that router is not rebuilt unnecessarily during the install.     // Currently it is built once during the install in install_finished().     $this->assertSame(1, \Drupal::service('core.performance.test.recorder')->getCount('event', RoutingEvents::FINISHED));
  }

}
    $this->initMink();

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

  /** * {@inheritdoc} */
  public function installDrupal() {
    $this->initUserSession();
    $this->prepareSettings();
    $this->doInstall();
    $this->initSettings();

    $request = Request::createFromGlobals();
    $container = $this->initKernel($request);
    $this->initConfig($container);
  }

  /** * {@inheritdoc} */
  
if ($database->databaseType() !== 'mysql' || $is_maria || version_compare($database->version(), '8.0.13', '<')) {
      $this->markTestSkipped('This test only runs on MySQL 8.0.13 and above');
    }

    $database->query("SET sql_require_primary_key = 1;")->execute();
  }

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

    // Set sql_require_primary_key for any future connections.     $settings['databases']['default']['default']['init_commands'] = (object) [
      'value'    => ['sql_require_primary_key' => 'SET sql_require_primary_key = 1;'],
      'required' => TRUE,
    ];
    $this->writeSettings($settings);
  }

  /** * {@inheritdoc} */
Home | Imprint | This part of the site doesn't use cookies.