You are here

public function LanguageCookieNegotiationConfigTest::testLanguageCookieSecureOption in Language Cookie 8

Test the language_cookie secure config option.

File

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

Class

LanguageCookieNegotiationConfigTest
Test the language cookie negotiation config.

Namespace

Drupal\Tests\language_cookie\Functional

Code

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