installModulesFromClassProperty example

/** * {@inheritdoc} */
  protected function installModulesFromClassProperty(ContainerInterface $container) {
    self::$modules = [
      'js_testing_log_test',
      'jquery_keyevent_polyfill_test',
    ];
    if ($this->disableCssAnimations) {
      self::$modules[] = 'css_disable_transitions_test';
    }
    parent::installModulesFromClassProperty($container);
  }

  /** * {@inheritdoc} */
  protected function initFrontPage() {
    parent::initFrontPage();
    // Set a standard window size so that all javascript tests start with the     // same viewport.     $this->getSession()->resizeWindow(1024, 768);
  }

  
/** * 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();

    // Generate a route to prime the URL generator with the correct base URL.     // @todo Remove in https://www.drupal.org/project/drupal/issues/3207896.     Url::fromRoute('<front>')->setAbsolute()->toString();

    // Explicitly call register() again on the container registered in \Drupal.     // @todo This should already be called through
__DIR__ . '/../../../../../system/tests/fixtures/update/drupal-9.4.0.bare.standard.php.gz',
      __DIR__ . '/../../../fixtures/update/fix-revision-id-update.php',
    ];
  }

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

    $this->installModulesFromClassProperty($this->container);
  }

  /** * Tests the upgrade path for revision ids in field aliases. */
  public function testViewsPostUpdateFixRevisionId() {
    $view = View::load('test_fix_revision_id_update');
    $data = $view->toArray();
    $fields = $data['display']['default']['display_options']['fields'];

    $this->assertArrayHasKey('field_test-revision_id_1', $fields);
    
Home | Imprint | This part of the site doesn't use cookies.