function BaseFieldOverrideValidationTest::testImmutableProperties

Same name in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Entity/BaseFieldOverrideValidationTest.php \Drupal\KernelTests\Core\Entity\BaseFieldOverrideValidationTest::testImmutableProperties()

Overrides ConfigEntityValidationTestBase::testImmutableProperties

File

core/tests/Drupal/KernelTests/Core/Entity/BaseFieldOverrideValidationTest.php, line 61

Class

BaseFieldOverrideValidationTest
Tests validation of base_field_override entities.

Namespace

Drupal\KernelTests\Core\Entity

Code

public function testImmutableProperties(array $valid_values = []) : void {
    // If we don't clear the previous settings here, we will get unrelated
    // validation errors (in addition to the one we're expecting), because the
    // settings from the *old* field_type won't match the config schema for the
    // settings of the *new* field_type.
    $this->entity
        ->set('settings', []);
    parent::testImmutableProperties([
        'entity_type' => 'entity_test_with_bundle',
        'bundle' => 'another',
        'field_type' => 'string',
    ]);
}

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