You are here

public function UrlBubbleableMetadataBubblingTest::testUrlBubbleableMetadataBubbling in Zircon Profile 8

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

Tests that URL bubbleable metadata is correctly bubbled.

File

core/modules/system/src/Tests/Render/UrlBubbleableMetadataBubblingTest.php, line 38
Contains \Drupal\system\Tests\Render\UrlBubbleableMetadataBubblingTest.

Class

UrlBubbleableMetadataBubblingTest
Tests that URL bubbleable metadata is correctly bubbled.

Namespace

Drupal\system\Tests\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
    ->assertRaw($url
    ->setAbsolute()
    ->toString());
}