function FilterCrudTest::testDisableFallbackFormat

Tests disabling the fallback text format.

File

core/modules/filter/tests/src/Kernel/FilterCrudTest.php, line 78

Class

FilterCrudTest
Tests creation, loading, updating, deleting of text formats and filters.

Namespace

Drupal\Tests\filter\Kernel

Code

public function testDisableFallbackFormat() : void {
  $this->installConfig([
    'filter',
  ]);
  $message = '\\LogicException with message "The fallback text format \'plain_text\' cannot be disabled." was thrown.';
  try {
    FilterFormat::load('plain_text')->disable();
    $this->fail($message);
  } catch (\LogicException $e) {
    $this->assertSame("The fallback text format 'plain_text' cannot be disabled.", $e->getMessage(), $message);
  }
}

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