public function LayoutBuilderElementTest::testConstructorMessengerDeprecation in Drupal 9
@group legacy
File
- core/
modules/ layout_builder/ tests/ src/ Kernel/ LayoutBuilderElementTest.php, line 38
Class
- LayoutBuilderElementTest
- Tests the deprecation notices of the layout builder element.
Namespace
Drupal\Tests\layout_builder\KernelCode
public function testConstructorMessengerDeprecation() {
$this
->expectDeprecation('Calling LayoutBuilder::__construct() with the $messenger argument is deprecated in drupal:9.1.0 and will be removed in drupal:10.0.0. See https://www.drupal.org/node/3152690');
$event_dispatcher = $this
->prophesize(EventDispatcherInterface::class);
$messenger = $this
->prophesize(MessengerInterface::class);
$element = new LayoutBuilder([], 'element_id', [], $event_dispatcher
->reveal(), $messenger
->reveal());
$this
->assertNotNull($element);
}