function BaseFieldOverrideValidationTest::testFieldTypePluginIsValidated
Same name in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Entity/BaseFieldOverrideValidationTest.php \Drupal\KernelTests\Core\Entity\BaseFieldOverrideValidationTest::testFieldTypePluginIsValidated()
Tests that the field type plugin's existence is validated.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ BaseFieldOverrideValidationTest.php, line 77
Class
- BaseFieldOverrideValidationTest
- Tests validation of base_field_override entities.
Namespace
Drupal\KernelTests\Core\EntityCode
public function testFieldTypePluginIsValidated() : void {
// The `field_type` property is immutable, so we need to clone the entity in
// order to cleanly change its field_type property to some invalid value.
$this->entity = $this->entity
->createDuplicate()
->set('field_type', 'invalid');
$this->assertValidationErrors([
'field_type' => "The 'invalid' plugin does not exist.",
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.