You are here

public function LanguageIntegrationTest::testAdminTranslation in Facets 8

Tests the admin translation screen.

File

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

Class

LanguageIntegrationTest
Tests the integration with the language module.

Namespace

Drupal\Tests\facets\Functional

Code

public function testAdminTranslation() {
  $id = 'water_bear';
  $this
    ->createFacet('Water bear', $id);

  // Translate the facet.
  $this
    ->drupalGet('admin/config/search/facets/' . $id . '/edit/translate/xx-lolspeak/add');
  $this
    ->drupalPostForm(NULL, [
    'translation[config_names][facets.facet.water_bear][name]' => 'Tardigrade',
  ], 'Save translation');
  $this
    ->drupalGet('admin/config/search/facets');
  $this
    ->assertSession()
    ->pageTextContains('Water bear');
  $this
    ->drupalGet('xx-lolspeak/admin/config/search/facets');
  $this
    ->assertSession()
    ->pageTextContains('Tardigrade');
}