function PathParentCacheContextTest::testGetContext
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php \Drupal\Tests\Core\Cache\Context\PathParentCacheContextTest::testGetContext()
- 8.9.x core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php \Drupal\Tests\Core\Cache\Context\PathParentCacheContextTest::testGetContext()
- 10 core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php \Drupal\Tests\Core\Cache\Context\PathParentCacheContextTest::testGetContext()
@covers ::getContext
@dataProvider providerTestGetContext
File
-
core/
tests/ Drupal/ Tests/ Core/ Cache/ Context/ PathParentCacheContextTest.php, line 23
Class
- PathParentCacheContextTest
- @coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Cache%21Context%21PathParentCacheContext.php/class/PathParentCacheContext/11.x" title="Defines a cache context service for path parents." class="local">\Drupal\Core\Cache\Context\PathParentCacheContext</a> @group Cache
Namespace
Drupal\Tests\Core\Cache\ContextCode
public function testGetContext($original_path, $context) : void {
$request_stack = new RequestStack();
$request = Request::create($original_path);
$request_stack->push($request);
$cache_context = new PathParentCacheContext($request_stack);
$this->assertSame($cache_context->getContext(), $context);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.