Mercurial > hg > isophonics-drupal-site
comparison core/modules/system/src/Tests/Render/UrlBubbleableMetadataBubblingTest.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\system\Tests\Render; | |
4 | |
5 use Drupal\Core\Url; | |
6 use Drupal\simpletest\WebTestBase; | |
7 | |
8 /** | |
9 * Tests that URL bubbleable metadata is correctly bubbled. | |
10 * | |
11 * @group Render | |
12 */ | |
13 class UrlBubbleableMetadataBubblingTest extends WebTestBase { | |
14 | |
15 /** | |
16 * Modules to enable. | |
17 * | |
18 * @var array | |
19 */ | |
20 public static $modules = ['cache_test']; | |
21 | |
22 /** | |
23 * {@inheritdoc} | |
24 */ | |
25 protected function setUp() { | |
26 parent::setUp(); | |
27 $this->dumpHeaders = TRUE; | |
28 } | |
29 | |
30 /** | |
31 * Tests that URL bubbleable metadata is correctly bubbled. | |
32 */ | |
33 public function testUrlBubbleableMetadataBubbling() { | |
34 // Test that regular URLs bubble up bubbleable metadata when converted to | |
35 // string. | |
36 $url = Url::fromRoute('cache_test.url_bubbling'); | |
37 $this->drupalGet($url); | |
38 $this->assertCacheContext('url.site'); | |
39 $this->assertRaw($url->setAbsolute()->toString()); | |
40 } | |
41 | |
42 } |