You are here

public function LayoutBuilderElementTest::testConstructorTempStoreDeprecation in Drupal 9

@group legacy

File

core/modules/layout_builder/tests/src/Kernel/LayoutBuilderElementTest.php, line 23

Class

LayoutBuilderElementTest
Tests the deprecation notices of the layout builder element.

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function testConstructorTempStoreDeprecation() {
  $this
    ->expectDeprecation('The event_dispatcher service should be passed to LayoutBuilder::__construct() instead of the layout_builder.tempstore_repository service since 9.1.0. This will be required in Drupal 10.0.0. See https://www.drupal.org/node/3152690');
  $layout_temp_storage = $this
    ->prophesize(LayoutTempstoreRepositoryInterface::class);
  $element = new LayoutBuilder([], 'element_id', [], $layout_temp_storage
    ->reveal());
  $this
    ->assertNotNull($element);
}