You are here

public function LanguageCookiePageCacheTest::testLanguageCookieFrontPageCache in Language Cookie 8

Test that the language cookie module works with page_cache enabled.

File

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

Class

LanguageCookiePageCacheTest
Tests that the condition plugins work.

Namespace

Drupal\Tests\language_cookie\Functional

Code

public function testLanguageCookieFrontPageCache() {

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