You are here

public function SolrFieldTypeTest::setUp in Search API Solr 8.3

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/SolrFieldTypeTest.php \Drupal\Tests\search_api_solr\Kernel\SolrFieldTypeTest::setUp()
  2. 4.x tests/src/Kernel/SolrFieldTypeTest.php \Drupal\Tests\search_api_solr\Kernel\SolrFieldTypeTest::setUp()

Overrides KernelTestBase::setUp

File

tests/src/Kernel/SolrFieldTypeTest.php, line 48

Class

SolrFieldTypeTest
Provides tests for Solr field typa configs.

Namespace

Drupal\Tests\search_api_solr\Kernel

Code

public function setUp() {
  parent::setUp();
  $fileSystem = \Drupal::service('file_system');
  $this->configNames = array_keys(\Drupal::service('file_system')
    ->scanDirectory(__DIR__ . '/../../../config', '/search_api_solr.solr_field_type.text_/', [
    'key' => 'name',
  ]));
  foreach ($this->configNames as $config_name) {
    preg_match('/search_api_solr.solr_field_type.text_(.*)_\\d+_\\d+_\\d+/', $config_name, $matches);
    $this->languageIds[] = $matches[1];
  }
  $this->languageIds = array_unique($this->languageIds);
  foreach ($this->languageIds as $language_id) {
    if ('und' != $language_id) {
      ConfigurableLanguage::createFromLangcode($language_id)
        ->save();
    }
  }
}