You are here

public function SmsDevelMessageTest::testSendSkipQueue in SMS Framework 8

Same name and namespace in other branches
  1. 2.x modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php \Drupal\Tests\sms_devel\Functional\SmsDevelMessageTest::testSendSkipQueue()
  2. 2.1.x modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php \Drupal\Tests\sms_devel\Functional\SmsDevelMessageTest::testSendSkipQueue()

Tests sending functionality skipping queue.

File

modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php, line 46

Class

SmsDevelMessageTest
Tests the message form.

Namespace

Drupal\Tests\sms_devel\Functional

Code

public function testSendSkipQueue() {
  $edit['number'] = $this
    ->randomPhoneNumbers(1)[0];
  $edit['message'] = $this
    ->randomString();
  $edit['skip_queue'] = TRUE;
  $this
    ->drupalPostForm(Url::fromRoute('sms_devel.message'), $edit, t('Send'));
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->responseContains('Message was processed, 1 delivery reports were generated.');
  $messages = $this
    ->getTestMessages($this->gateway);
  $this
    ->assertEquals(1, count($messages));
  $this
    ->assertEquals($edit['message'], $messages[0]
    ->getMessage());
}