function ContextDefinitionTest::testEntityContextDefinitionAssert

Same name in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Plugin/ContextDefinitionTest.php \Drupal\KernelTests\Core\Plugin\ContextDefinitionTest::testEntityContextDefinitionAssert()
  2. 11.x 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 52

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');
}

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