You are here

public function SmsDevelMessageTest::testAutomated 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::testAutomated()
  2. 2.1.x modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php \Drupal\Tests\sms_devel\Functional\SmsDevelMessageTest::testAutomated()

Tests tagging message as automated.

File

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

Class

SmsDevelMessageTest
Tests the message form.

Namespace

Drupal\Tests\sms_devel\Functional

Code

public function testAutomated() {
  $edit['number'] = $this
    ->randomPhoneNumbers(1)[0];
  $edit['message'] = $this
    ->randomString();
  $edit['skip_queue'] = FALSE;
  $edit['automated'] = FALSE;
  $this
    ->drupalPostForm(Url::fromRoute('sms_devel.message'), $edit, t('Send'));
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $messages = SmsMessage::loadMultiple();
  $message = reset($messages);
  $this
    ->assertFalse($message
    ->isAutomated(), 'Message is not automated');
}