You are here

public function ChildLoginTest::testLogout in Bakery Single Sign-On System 8.2

File

tests/src/Functional/ChildLoginTest.php, line 54

Class

ChildLoginTest

Namespace

Drupal\Tests\bakery\Functional

Code

public function testLogout() {
  $account = $this
    ->createUser([
    'access user profiles',
  ]);
  $assert_session = $this
    ->assertSession();

  // Set a cookie signed by the main site and matching a user. Should log in.
  $this
    ->bakeCookie(new ChocolateChip($account
    ->getAccountName(), $account
    ->getEmail(), $account
    ->getInitialEmail(), '1'));
  $this
    ->drupalGet('');
  $assert_session
    ->responseContains($account
    ->getAccountName());
  $this
    ->drupalLogout();
  $assert_session
    ->responseNotContains($account
    ->getAccountName());
}