3 namespace Drupal\KernelTests\Core\Plugin;
5 use Drupal\Core\Entity\Entity\EntityViewDisplay;
6 use Drupal\Core\Plugin\Context\EntityContext;
7 use Drupal\KernelTests\KernelTestBase;
10 * Tests the interaction between entity context and typed data.
14 class EntityContextTypedDataTest extends KernelTestBase {
19 protected static $modules = ['entity_test'];
22 * Tests that entity contexts wrapping a config entity can be validated.
24 public function testValidateConfigEntityContext() {
25 $display = EntityViewDisplay::create([
26 'targetEntityType' => 'entity_test',
27 'bundle' => 'entity_test',
33 $violations = EntityContext::fromEntity($display)->validate();
34 $this->assertCount(0, $violations);