You are here

public function UrlBubbleableMetadataBubblingTest::testUrlBubbleableMetadataBubbling in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php \Drupal\Tests\system\Functional\Render\UrlBubbleableMetadataBubblingTest::testUrlBubbleableMetadataBubbling()

Tests that URL bubbleable metadata is correctly bubbled.

File

core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php, line 40

Class

UrlBubbleableMetadataBubblingTest
Tests that URL bubbleable metadata is correctly bubbled.

Namespace

Drupal\Tests\system\Functional\Render

Code

public function testUrlBubbleableMetadataBubbling() {

  // Test that regular URLs bubble up bubbleable metadata when converted to
  // string.
  $url = Url::fromRoute('cache_test.url_bubbling');
  $this
    ->drupalGet($url);
  $this
    ->assertCacheContext('url.site');
  $this
    ->assertSession()
    ->responseContains($url
    ->setAbsolute()
    ->toString());
}