function EditorValidationTest::testInvalidFormat

Same name in other branches
  1. 11.x core/modules/editor/tests/src/Kernel/EditorValidationTest.php \Drupal\Tests\editor\Kernel\EditorValidationTest::testInvalidFormat()

Tests validating an editor with a non-existent `format`.

File

core/modules/editor/tests/src/Kernel/EditorValidationTest.php, line 114

Class

EditorValidationTest
Tests validation of editor entities.

Namespace

Drupal\Tests\editor\Kernel

Code

public function testInvalidFormat() : void {
    $this->entity
        ->set('format', 'non_existent');
    $this->assertValidationErrors([
        '' => "The 'format' property cannot be changed.",
        'format' => "The 'filter.format.non_existent' config does not exist.",
    ]);
}

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