function LayoutBuilderEntityViewDisplayTest::testInvalidConfiguration

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Kernel\LayoutBuilderEntityViewDisplayTest::testInvalidConfiguration()
  2. 8.9.x core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Kernel\LayoutBuilderEntityViewDisplayTest::testInvalidConfiguration()
  3. 10 core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php \Drupal\Tests\layout_builder\Kernel\LayoutBuilderEntityViewDisplayTest::testInvalidConfiguration()

Tests that configuration schema enforces valid values.

File

core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php, line 40

Class

LayoutBuilderEntityViewDisplayTest
@coversDefaultClass \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function testInvalidConfiguration() : void {
    $this->expectException(SchemaIncompleteException::class);
    $this->sectionList
        ->getSection(0)
        ->getComponent('10000000-0000-1000-a000-000000000000')
        ->setConfiguration([
        'id' => 'foo',
        'bar' => 'baz',
    ]);
    $this->sectionList
        ->save();
}

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