class UrlBubbleableMetadataBubblingTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php \Drupal\Tests\system\Functional\Render\UrlBubbleableMetadataBubblingTest
- 10 core/modules/system/tests/src/Functional/Render/UrlBubbleableMetadataBubblingTest.php \Drupal\Tests\system\Functional\Render\UrlBubbleableMetadataBubblingTest
- 8.9.x 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\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Functional\Render\UrlBubbleableMetadataBubblingTest uses \Drupal\Tests\system\Functional\Cache\AssertPageCacheContextsAndTagsTrait implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of UrlBubbleableMetadataBubblingTest
File
-
core/
modules/ system/ tests/ src/ Functional/ Render/ UrlBubbleableMetadataBubblingTest.php, line 14
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());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.