You are here

public function SmsFrameworkWebTest::testSendSms in SMS Framework 7

Tests the sending of messages.

File

tests/sms.module.test, line 71
Contains tests for the functions in sms.module and core sms framework.

Class

SmsFrameworkWebTest
Provides integration tests for the SMS Framework.

Code

public function testSendSms() {
  $message = 'This is a test message';
  $number = '23412345678';
  $options = array(
    'sender' => 'Sender',
    'gateway' => 'test',
  );

  // Send sms to test gateway.
  $result = sms_send($number, $message, $options);
  $this
    ->assertTrue($result, 'Message successfully sent.');
  $this
    ->assertEqual(sms_test_gateway_result(), array(
    'number' => $number,
    'message' => $message,
    'options' => $options,
  ), 'Message sent to the correct gateway.');
}