Same name and namespace in other branches
- 8.9.x core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php \Drupal\Tests\system\Functional\Render\UrlBubbleableMetadataBubblingTest
- 9 core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php \Drupal\Tests\system\Functional\Render\UrlBubbleableMetadataBubblingTest
Tests that URL bubbleable metadata is correctly bubbled.
@group Render
Hierarchy
- class \Drupal\Tests\system\Functional\Render\UrlBubbleableMetadataBubblingTest extends \Drupal\Tests\BrowserTestBase uses AssertPageCacheContextsAndTagsTrait
Expanded class hierarchy of UrlBubbleableMetadataBubblingTest
File
- core/
modules/ system/ tests/ src/ Functional/ Render/ UrlBubbleableMetadataBubblingTest.php, line 16
Namespace
Drupal\Tests\system\Functional\RenderView source
class UrlBubbleableMetadataBubblingTest extends BrowserTestBase {
use AssertPageCacheContextsAndTagsTrait;
/**
* Modules to enable.
*
* @var array
*/
protected static $modules = [
'cache_test',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
}
/**
* Tests that URL bubbleable metadata is correctly bubbled.
*/
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());
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AssertPageCacheContextsAndTagsTrait:: |
protected | function | Asserts whether an expected cache context was present in the last response. | |
AssertPageCacheContextsAndTagsTrait:: |
protected | function | Ensures that some cache contexts are present in the current response. | |
AssertPageCacheContextsAndTagsTrait:: |
protected | function | Asserts the max age header. | |
AssertPageCacheContextsAndTagsTrait:: |
protected | function | Ensures that some cache tags are present in the current response. | |
AssertPageCacheContextsAndTagsTrait:: |
protected | function | Asserts that a cache context was not present in the last response. | |
AssertPageCacheContextsAndTagsTrait:: |
protected | function | Asserts page cache miss, then hit for the given URL; checks cache headers. | |
AssertPageCacheContextsAndTagsTrait:: |
protected | function | Enables page caching. | |
AssertPageCacheContextsAndTagsTrait:: |
protected | function | Gets a specific header value as array. | |
UrlBubbleableMetadataBubblingTest:: |
protected | property | ||
UrlBubbleableMetadataBubblingTest:: |
protected static | property | Modules to enable. | |
UrlBubbleableMetadataBubblingTest:: |
protected | function | ||
UrlBubbleableMetadataBubblingTest:: |
public | function | Tests that URL bubbleable metadata is correctly bubbled. |