You are here

public function LanguageCookieNegotiationConfigTest::testLanguageCookieDomainOption in Language Cookie 8

Test the language_cookie domain config option.

File

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

Class

LanguageCookieNegotiationConfigTest
Test the language cookie negotiation config.

Namespace

Drupal\Tests\language_cookie\Functional

Code

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