You are here

public function LanguageCookiePageCacheTest::testLanguageCookiePageCache in Language Cookie 8

Test that the language cookie module works with page_cache enabled.

File

tests/src/Functional/LanguageCookiePageCacheTest.php, line 33

Class

LanguageCookiePageCacheTest
Tests that the condition plugins work.

Namespace

Drupal\Tests\language_cookie\Functional

Code

public function testLanguageCookiePageCache() {

  // Create a node and add a translation.
  $node = $this
    ->drupalCreateNode([
    'title' => 'Title EN',
  ]);
  $node
    ->addTranslation('fr', [
    'title' => 'Title FR',
  ]);
  $node
    ->save();
  $this
    ->drupalLogout();
  $this
    ->drupalGet('node/' . $node
    ->id());
  $this
    ->assertSession()
    ->titleEquals('Title EN | Drupal');
  $this
    ->drupalGet('/fr/user');
  $this
    ->drupalGet('node/' . $node
    ->id());
  $this
    ->assertSession()
    ->titleEquals('Title FR | Drupal');
}