You are here

public function ContextDefinitionTest::testEntityContextDefinitionAssert in Drupal 9

Same name and namespace in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Plugin/ContextDefinitionTest.php \Drupal\KernelTests\Core\Plugin\ContextDefinitionTest::testEntityContextDefinitionAssert()

@covers ::__construct

File

core/tests/Drupal/KernelTests/Core/Plugin/ContextDefinitionTest.php, line 41

Class

ContextDefinitionTest
@coversDefaultClass \Drupal\Core\Plugin\Context\ContextDefinition @group Plugin

Namespace

Drupal\KernelTests\Core\Plugin

Code

public function testEntityContextDefinitionAssert() {
  $this
    ->expectException(\AssertionError::class);
  $this
    ->expectExceptionMessage('assert(strpos($data_type, \'entity:\') !== 0 || $this instanceof EntityContextDefinition)');
  new ContextDefinition('entity:entity_test');
}