You are here

public function SmsTestEventSubscriber::testAddGateway200 in SMS Framework 8

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

Adds a gateway with ID 'test_gateway_200', with weight '200'.

Parameters

\Drupal\sms\Event\RecipientGatewayEvent $event: The RecipientGatewayEvent event.

File

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

Class

SmsTestEventSubscriber
Test event subscriber.

Namespace

Drupal\sms_test\EventSubscriber

Code

public function testAddGateway200(RecipientGatewayEvent $event) {
  if (\Drupal::state()
    ->get('sms_test_event_subscriber__test_gateway_200', FALSE)) {
    $gateway = SmsGateway::load('test_gateway_200');
    $event
      ->addGateway($gateway, 200);
  }
}