You are here

public function LanguageIntegrationTest::setUp in Facets 8

Overrides FacetsTestBase::setUp

File

tests/src/Functional/LanguageIntegrationTest.php, line 31

Class

LanguageIntegrationTest
Tests the integration with the language module.

Namespace

Drupal\Tests\facets\Functional

Code

public function setUp() {
  parent::setUp();
  $this->adminUser = $this
    ->drupalCreateUser([
    'administer search_api',
    'administer facets',
    'access administration pages',
    'administer nodes',
    'access content overview',
    'administer content types',
    'administer blocks',
    'translate configuration',
  ]);
  $this
    ->drupalLogin($this->adminUser);
  ConfigurableLanguage::create([
    'id' => 'xx-lolspeak',
    'label' => 'Lolspeak',
  ])
    ->save();
  ConfigurableLanguage::create([
    'id' => 'nl',
    'label' => 'Dutch',
  ])
    ->save();
  ConfigurableLanguage::create([
    'id' => 'es',
    'label' => 'Spanish',
  ])
    ->save();
  $this
    ->setUpExampleStructure();
  $this
    ->insertExampleContent();
  $this
    ->assertEquals($this
    ->indexItems($this->indexId), 5, '5 items were indexed.');

  // Make absolutely sure the ::$blocks variable doesn't pass information
  // along between tests.
  $this->blocks = NULL;
}