function MediaTypeValidationTest::testImmutableProperties

Same name and namespace in other branches
  1. 11.x core/modules/media/tests/src/Kernel/MediaTypeValidationTest.php \Drupal\Tests\media\Kernel\MediaTypeValidationTest::testImmutableProperties()

Overrides ConfigEntityValidationTestBase::testImmutableProperties

File

core/modules/media/tests/src/Kernel/MediaTypeValidationTest.php, line 33

Class

MediaTypeValidationTest
Tests validation of media_type entities.

Namespace

Drupal\Tests\media\Kernel

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* source won't match the config schema for the
    // settings of the *new* source.
    $this->entity
        ->set('source_configuration', []);
    $valid_values['source'] = 'image';
    parent::testImmutableProperties($valid_values);
}

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