3 namespace Drupal\Tests\system\Functional\Render;
6 use Drupal\Tests\BrowserTestBase;
7 use Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait;
10 * Tests that URL bubbleable metadata is correctly bubbled.
14 class UrlBubbleableMetadataBubblingTest extends BrowserTestBase {
16 use AssertPageCacheContextsAndTagsTrait;
23 public static $modules = ['cache_test'];
28 protected function setUp() {
33 * Tests that URL bubbleable metadata is correctly bubbled.
35 public function testUrlBubbleableMetadataBubbling() {
36 // Test that regular URLs bubble up bubbleable metadata when converted to
38 $url = Url::fromRoute('cache_test.url_bubbling');
39 $this->drupalGet($url);
40 $this->assertCacheContext('url.site');
41 $this->assertRaw($url->setAbsolute()->toString());