You are here

protected function SmsFrameworkTestTrait::setFallbackGateway in SMS Framework 2.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::setFallbackGateway()
  2. 2.1.x tests/src/Functional/SmsFrameworkTestTrait.php \Drupal\Tests\sms\Functional\SmsFrameworkTestTrait::setFallbackGateway()

Sets the fallback gateway.

Parameters

\Drupal\sms\Entity\SmsGatewayInterface|null $sms_gateway: The new site fallback SMS Gateway, or NULL to unset.

21 calls to SmsFrameworkTestTrait::setFallbackGateway()
SmsBlastBrowserTest::setUp in modules/sms_blast/tests/src/Functional/SmsBlastBrowserTest.php
SmsDevelMessageTest::setUp in modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php
SmsDevelMessageTest::testNoFallbackGateway in modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php
Tests error shown if gateway found for message.
SmsFrameworkPhoneNumberProviderTest::setUp in tests/src/Kernel/SmsFrameworkPhoneNumberProviderTest.php
SmsFrameworkPhoneNumberTest::setUp in tests/src/Functional/SmsFrameworkPhoneNumberTest.php

... See full list

File

tests/src/Functional/SmsFrameworkTestTrait.php, line 27

Class

SmsFrameworkTestTrait
Shared SMS Framework helpers for kernel and web tests.

Namespace

Drupal\Tests\sms\Functional

Code

protected function setFallbackGateway(SmsGatewayInterface $sms_gateway = NULL) {
  $sms_gateway = $sms_gateway ? $sms_gateway
    ->id() : NULL;
  $this
    ->config('sms.settings')
    ->set('fallback_gateway', $sms_gateway)
    ->save();
}