function EntityContextTypedDataTest::testValidateConfigEntityContext
Tests that entity contexts wrapping a config entity can be validated.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Plugin/ EntityContextTypedDataTest.php, line 28
Class
- EntityContextTypedDataTest
- Tests the interaction between entity context and typed data.
Namespace
Drupal\KernelTests\Core\PluginCode
public function testValidateConfigEntityContext() : void {
$display = EntityViewDisplay::create([
'targetEntityType' => 'entity_test',
'bundle' => 'entity_test',
'mode' => 'default',
'status' => TRUE,
]);
$display->save();
$violations = EntityContext::fromEntity($display)->validate();
$this->assertCount(0, $violations);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.