You are here

public function SmsTestEventSubscriber::testExecutionOrder in SMS Framework 2.1.x

Same name and namespace in other branches
  1. 8 tests/modules/sms_test/src/EventSubscriber/SmsTestEventSubscriber.php \Drupal\sms_test\EventSubscriber\SmsTestEventSubscriber::testExecutionOrder()
  2. 2.x tests/modules/sms_test/src/EventSubscriber/SmsTestEventSubscriber.php \Drupal\sms_test\EventSubscriber\SmsTestEventSubscriber::testExecutionOrder()

Adds event name to execution order when a message is processed.

Parameters

\Symfony\Component\EventDispatcher\Event $event: The event.

string $eventName: The event name.

File

tests/modules/sms_test/src/EventSubscriber/SmsTestEventSubscriber.php, line 52

Class

SmsTestEventSubscriber
Test event subscriber.

Namespace

Drupal\sms_test\EventSubscriber

Code

public function testExecutionOrder(Event $event, $eventName) {
  $execution_order = \Drupal::state()
    ->get('sms_test_event_subscriber__execution_order', []);
  $execution_order[] = $eventName;
  \Drupal::state()
    ->set('sms_test_event_subscriber__execution_order', $execution_order);
}