You are here

public function UrlAlterTest::testUrlWithQueryString in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php \Drupal\KernelTests\Core\Path\UrlAlterTest::testUrlWithQueryString()
  2. 9 core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php \Drupal\KernelTests\Core\Path\UrlAlterTest::testUrlWithQueryString()

File

core/tests/Drupal/KernelTests/Core/Path/UrlAlterTest.php, line 22

Class

UrlAlterTest
Tests the capability to alter URLs.

Namespace

Drupal\KernelTests\Core\Path

Code

public function testUrlWithQueryString() {

  // Test outbound query string altering.
  $url = Url::fromRoute('user.login');
  $this
    ->assertEquals(\Drupal::request()
    ->getBaseUrl() . '/user/login?foo=bar', $url
    ->toString());
}