function LayoutBuilderEntityViewDisplayTest::testInvalidConfiguration

Same name and namespace 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. 11.x 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 41

Class

LayoutBuilderEntityViewDisplayTest
@coversDefaultClass \Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay[[api-linebreak]]

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.