public function EntityContextTypedDataTest::testValidateConfigEntityContext in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Plugin/EntityContextTypedDataTest.php \Drupal\KernelTests\Core\Plugin\EntityContextTypedDataTest::testValidateConfigEntityContext()
Tests that entity contexts wrapping a config entity can be validated.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Plugin/ EntityContextTypedDataTest.php, line 24
Class
- EntityContextTypedDataTest
- Tests the interaction between entity context and typed data.
Namespace
Drupal\KernelTests\Core\PluginCode
public function testValidateConfigEntityContext() {
$display = EntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
'mode' => 'default',
'status' => TRUE,
]);
$display
->save();
$violations = EntityContext::fromEntity($display)
->validate();
$this
->assertCount(0, $violations);
}