function UserLoginHttpTest::testLogin

Same name in other branches
  1. 9 core/modules/user/tests/src/Functional/UserLoginHttpTest.php \Drupal\Tests\user\Functional\UserLoginHttpTest::testLogin()
  2. 8.9.x core/modules/user/tests/src/Functional/UserLoginHttpTest.php \Drupal\Tests\user\Functional\UserLoginHttpTest::testLogin()
  3. 10 core/modules/user/tests/src/Functional/UserLoginHttpTest.php \Drupal\Tests\user\Functional\UserLoginHttpTest::testLogin()

Tests user session life cycle.

File

core/modules/user/tests/src/Functional/UserLoginHttpTest.php, line 104

Class

UserLoginHttpTest
Tests login and password reset via direct HTTP.

Namespace

Drupal\Tests\user\Functional

Code

public function testLogin() : void {
    // Without the serialization module only JSON is supported.
    $this->doTestLogin('json');
    // Enable serialization so we have access to additional formats.
    $this->container
        ->get('module_installer')
        ->install([
        'serialization',
    ]);
    $this->rebuildAll();
    $this->doTestLogin('json');
    $this->doTestLogin('xml');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.