function BlockValidationTest::testThemeValidation

Tests validating a block with a non-existent theme.

File

core/modules/block/tests/src/Kernel/BlockValidationTest.php, line 119

Class

BlockValidationTest
Tests validation of block entities.

Namespace

Drupal\Tests\block\Kernel

Code

public function testThemeValidation() : void {
    $this->entity
        ->set('theme', 'non_existent');
    $this->assertValidationErrors([
        'region' => 'This is not a valid region of the <em class="placeholder">non_existent</em> theme.',
        'theme' => "Theme 'non_existent' is not installed.",
    ]);
}

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