You are here

protected function UserLoginHttpTest::getLoginStatusUrlString in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/user/tests/src/Functional/UserLoginHttpTest.php \Drupal\Tests\user\Functional\UserLoginHttpTest::getLoginStatusUrlString()
  2. 10 core/modules/user/tests/src/Functional/UserLoginHttpTest.php \Drupal\Tests\user\Functional\UserLoginHttpTest::getLoginStatusUrlString()

Gets the URL string for checking login.

Parameters

string $format: The format to use to make the request.

Return value

string The URL string.

2 calls to UserLoginHttpTest::getLoginStatusUrlString()
UserLoginHttpTest::doTestLogin in core/modules/user/tests/src/Functional/UserLoginHttpTest.php
Do login testing for a given serialization format.
UserLoginHttpTest::testLogoutCsrfProtection in core/modules/user/tests/src/Functional/UserLoginHttpTest.php
Tests csrf protection of User Logout route.

File

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

Class

UserLoginHttpTest
Tests login and password reset via direct HTTP.

Namespace

Drupal\Tests\user\Functional

Code

protected function getLoginStatusUrlString($format = 'json') {
  $user_login_status_url = Url::fromRoute('user.login_status.http');
  $user_login_status_url
    ->setRouteParameter('_format', $format);
  $user_login_status_url
    ->setAbsolute();
  return $user_login_status_url
    ->toString();
}