function QueryArgsCacheContextTest::testGetContext
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Cache/Context/QueryArgsCacheContextTest.php \Drupal\Tests\Core\Cache\Context\QueryArgsCacheContextTest::testGetContext()
- 10 core/tests/Drupal/Tests/Core/Cache/Context/QueryArgsCacheContextTest.php \Drupal\Tests\Core\Cache\Context\QueryArgsCacheContextTest::testGetContext()
- 11.x core/tests/Drupal/Tests/Core/Cache/Context/QueryArgsCacheContextTest.php \Drupal\Tests\Core\Cache\Context\QueryArgsCacheContextTest::testGetContext()
@covers ::getContext
@dataProvider providerTestGetContext
File
-
core/
tests/ Drupal/ Tests/ Core/ Cache/ Context/ QueryArgsCacheContextTest.php, line 21
Class
- QueryArgsCacheContextTest
- @coversDefaultClass \Drupal\Core\Cache\Context\QueryArgsCacheContext @group Cache
Namespace
Drupal\Tests\Core\Cache\ContextCode
public function testGetContext(array $query_args, $cache_context_parameter, $context) {
$request_stack = new RequestStack();
$request = Request::create('/', 'GET', $query_args);
$request_stack->push($request);
$cache_context = new QueryArgsCacheContext($request_stack);
$this->assertSame($cache_context->getContext($cache_context_parameter), $context);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.