public function QueryArgsCacheContextTest::testGetContext in Drupal 9
Same name and namespace in other branches
- 8 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()
@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);
}