You are here

public function SmsTestEventSubscriber::testAddGateway400 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::testAddGateway400()
  2. 2.x tests/modules/sms_test/src/EventSubscriber/SmsTestEventSubscriber.php \Drupal\sms_test\EventSubscriber\SmsTestEventSubscriber::testAddGateway400()

Adds a gateway with ID 'test_gateway_400', with weight '400'.

Parameters

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

File

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

Class

SmsTestEventSubscriber
Test event subscriber.

Namespace

Drupal\sms_test\EventSubscriber

Code

public function testAddGateway400(RecipientGatewayEvent $event) {
  if (\Drupal::state()
    ->get('sms_test_event_subscriber__test_gateway_400', FALSE)) {
    $gateway = SmsGateway::load('test_gateway_400');
    $event
      ->addGateway($gateway, 400);
  }
}