public function RouteGroupCacheContextTest::testGetContextNoGroup in Group 2.0.x
Same name and namespace in other branches
- 8 tests/src/Unit/RouteGroupCacheContextTest.php \Drupal\Tests\group\Unit\RouteGroupCacheContextTest::testGetContextNoGroup()
Tests getting the context value when there is no group on the route.
@covers ::getContext
File
- tests/
src/ Unit/ RouteGroupCacheContextTest.php, line 50
Class
- RouteGroupCacheContextTest
- Tests the route.group cache context.
Namespace
Drupal\Tests\group\UnitCode
public function testGetContextNoGroup() {
$this->currentRouteMatch
->getParameter('group')
->willReturn(NULL);
$this->currentRouteMatch
->getRouteName()
->willReturn('foo');
$cache_context = new RouteGroupCacheContext($this->currentRouteMatch
->reveal(), $this->entityTypeManager
->reveal());
$this
->assertSame('group.none', $cache_context
->getContext());
}