function MessengerLegacyTest::getMessengerService

Retrieves the Messenger service from LegacyMessenger.

Parameters

\Drupal\Core\Messenger\LegacyMessenger $legacy_messenger: The legacy messenger.

Return value

\Drupal\Core\Messenger\MessengerInterface|null A messenger implementation.

1 call to MessengerLegacyTest::getMessengerService()
MessengerLegacyTest::testMessages in core/tests/Drupal/KernelTests/Core/Messenger/MessengerLegacyTest.php
@covers \Drupal::messenger @covers ::getMessengerService @covers ::all @covers ::addMessage @covers ::addError @covers ::addStatus @covers ::addWarning

File

core/tests/Drupal/KernelTests/Core/Messenger/MessengerLegacyTest.php, line 34

Class

MessengerLegacyTest
@group Messenger @group legacy

Namespace

Drupal\KernelTests\Core\Messenger

Code

protected function getMessengerService(LegacyMessenger $legacy_messenger) {
    $method = new \ReflectionMethod($legacy_messenger, 'getMessengerService');
    $method->setAccessible(TRUE);
    return $method->invoke($legacy_messenger);
}

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