You are here

protected function SmsFrameworkTestTrait::createMemoryGateway in SMS Framework 8

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

Creates a memory gateway.

Parameters

array $values: Additional values to use when creating the gateway.

Return value

\Drupal\sms\Entity\SmsGatewayInterface A saved memory gateway.

37 calls to SmsFrameworkTestTrait::createMemoryGateway()
SmsBlastBrowserTest::setUp in modules/sms_blast/tests/src/Functional/SmsBlastBrowserTest.php
SmsDevelMessageTest::setUp in modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php
SmsFrameworkBrowserTest::testQueueReport in tests/src/Functional/SmsFrameworkBrowserTest.php
Tests queue statistics located on Drupal report page.
SmsFrameworkDeliveryReportTest::testDeliveryReports in tests/src/Functional/SmsFrameworkDeliveryReportTest.php
Tests delivery reports integration.
SmsFrameworkDeliveryReportUpdateTest::testDeliveryReportUpdate in tests/src/Kernel/SmsFrameworkDeliveryReportUpdateTest.php
Tests that delivery reports are updated after initial sending.

... See full list

File

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

Class

SmsFrameworkTestTrait
Shared SMS Framework helpers for kernel and web tests.

Namespace

Drupal\Tests\sms\Functional

Code

protected function createMemoryGateway(array $values = []) {
  $id = isset($values['id']) ? $values['id'] : Unicode::strtolower($this
    ->randomMachineName(16));
  $gateway = SmsGateway::create($values + [
    'plugin' => 'memory',
    'id' => $id,
    'label' => $this
      ->randomString(),
    'settings' => [
      'gateway_id' => $id,
    ],
  ] + $values);
  $gateway
    ->enable();
  $gateway
    ->save();
  return $gateway;
}