function LayoutBuilderIsActiveCacheContextTest::testGetContextMissingEntityTypeId

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/Unit/LayoutBuilderIsActiveCacheContextTest.php \Drupal\Tests\layout_builder\Unit\LayoutBuilderIsActiveCacheContextTest::testGetContextMissingEntityTypeId()
  2. 11.x core/modules/layout_builder/tests/src/Unit/LayoutBuilderIsActiveCacheContextTest.php \Drupal\Tests\layout_builder\Unit\LayoutBuilderIsActiveCacheContextTest::testGetContextMissingEntityTypeId()

@covers ::getContext

File

core/modules/layout_builder/tests/src/Unit/LayoutBuilderIsActiveCacheContextTest.php, line 29

Class

LayoutBuilderIsActiveCacheContextTest
@coversDefaultClass \Drupal\layout_builder\Cache\LayoutBuilderIsActiveCacheContext

Namespace

Drupal\Tests\layout_builder\Unit

Code

public function testGetContextMissingEntityTypeId() : void {
    $route_match = $this->prophesize(RouteMatchInterface::class);
    $cache_context = new LayoutBuilderIsActiveCacheContext($route_match->reveal());
    $this->expectException(\LogicException::class);
    $this->expectExceptionMessage('Missing entity type ID');
    $cache_context->getContext();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.