You are here

public function PathParentCacheContextTest::testGetContext in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Cache/Context/PathParentCacheContextTest.php \Drupal\Tests\Core\Cache\Context\PathParentCacheContextTest::testGetContext()
  2. 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 21

Class

PathParentCacheContextTest
@coversDefaultClass \Drupal\Core\Cache\Context\PathParentCacheContext @group Cache

Namespace

Drupal\Tests\Core\Cache\Context

Code

public function testGetContext($original_path, $context) {
  $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);
}