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