You are here

public function LanguageCookieNegotiationConfigTest::testLanguageCookiePathOption in Language Cookie 8

Test the language_cookie param config option.

File

tests/src/Functional/LanguageCookieNegotiationConfigTest.php, line 135

Class

LanguageCookieNegotiationConfigTest
Test the language cookie negotiation config.

Namespace

Drupal\Tests\language_cookie\Functional

Code

public function testLanguageCookiePathOption() {
  $config = $this
    ->config('language_cookie.negotiation');
  $config
    ->set('path', '/drupal');
  $config
    ->save();
  $node = $this
    ->drupalCreateNode();
  $this
    ->drupalGet('fr/node/' . $node
    ->id());
  $this
    ->assertRegExp('/path=\\/drupal;/i', $this
    ->drupalGetHeader('Set-Cookie'), 'Cookie contains path option.');
}