You are here

protected function SearchApiBrowserTestBase::initConfig in Search API 8

Initialize various configurations post-installation.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The container.

Overrides FunctionalTestSetupTrait::initConfig

File

tests/src/Functional/SearchApiBrowserTestBase.php, line 215

Class

SearchApiBrowserTestBase
Provides the base class for web tests for Search API.

Namespace

Drupal\Tests\search_api\Functional

Code

protected function initConfig(ContainerInterface $container) {
  parent::initConfig($container);
  if (!static::$additionalBundles) {
    return;
  }

  // This will just set the Drupal state to include the necessary bundles for
  // our test entity type. Otherwise, fields from those bundles won't be found
  // and thus removed from the test index. (We can't do it in setUp(), before
  // calling the parent method, since the container isn't set up at that
  // point.)
  $bundles = [
    'entity_test_mulrev_changed' => [
      'label' => 'Entity Test Bundle',
    ],
    'item' => [
      'label' => 'item',
    ],
    'article' => [
      'label' => 'article',
    ],
  ];
  \Drupal::state()
    ->set('entity_test_mulrev_changed.bundles', $bundles);
}