function RestLoginHttpTest::testLogin

Same name and namespace in other branches
  1. main core/modules/rest/tests/src/Functional/RestLoginHttpTest.php \Drupal\Tests\rest\Functional\RestLoginHttpTest::testLogin()

Tests user session life cycle.

File

core/modules/rest/tests/src/Functional/RestLoginHttpTest.php, line 107

Class

RestLoginHttpTest
Tests login and password reset via direct HTTP.

Namespace

Drupal\Tests\rest\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.