diff --git a/core/modules/filter/src/Tests/FilterCrudTest.php b/core/modules/filter/src/Tests/FilterCrudTest.php index d2d4d6f..95e1975 100644 --- a/core/modules/filter/src/Tests/FilterCrudTest.php +++ b/core/modules/filter/src/Tests/FilterCrudTest.php @@ -7,6 +7,7 @@ namespace Drupal\filter\Tests; +use Drupal\filter\Entity\FilterFormat; use Drupal\simpletest\KernelTestBase; /** @@ -21,7 +22,7 @@ class FilterCrudTest extends KernelTestBase { * * @var array */ - public static $modules = array('filter', 'filter_test'); + public static $modules = ['filter', 'filter_test', 'system', 'user']; /** * Tests CRUD operations for text formats and filters. @@ -74,6 +75,23 @@ function testTextFormatCrud() { } /** + * Tests disabling the fallback text format. + */ + public function testDisableFallbackFormat() { + $this->installConfig(['filter']); + $message = sprintf("Exception \\LogicalException (message \"The fallback text format 'plain_text' cannot be disabled.\") was thrown."); + try { + FilterFormat::load('plain_text')->disable(); + $this->fail($message); + } + catch (\LogicException $e) { + if ($e->getMessage() == "The fallback text format 'plain_text' cannot be disabled.") { + $this->pass($message); + } + } + } + + /** * Verifies that a text format is properly stored. */ function verifyTextFormat($format) {