public function SmsDevelMessageTest::testReceiveNoSkipQueue in SMS Framework 2.1.x
Same name and namespace in other branches
- 8 modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php \Drupal\Tests\sms_devel\Functional\SmsDevelMessageTest::testReceiveNoSkipQueue()
- 2.x modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php \Drupal\Tests\sms_devel\Functional\SmsDevelMessageTest::testReceiveNoSkipQueue()
Tests receiving functionality entering queue.
File
- modules/
sms_devel/ tests/ src/ Functional/ SmsDevelMessageTest.php, line 101
Class
- SmsDevelMessageTest
- Tests the message form.
Namespace
Drupal\Tests\sms_devel\FunctionalCode
public function testReceiveNoSkipQueue() {
$edit['number'] = $this
->randomPhoneNumbers(1)[0];
$edit['message'] = $this
->randomString();
$edit['gateway'] = $this->gateway
->id();
$edit['skip_queue'] = FALSE;
$this
->drupalPostForm(Url::fromRoute('sms_devel.message'), $edit, t('Receive'));
$this
->assertSession()
->responseContains('Message added to the incoming queue.');
$messages = SmsMessage::loadMultiple();
$message = reset($messages);
$this
->assertEquals($edit['message'], $message
->getMessage(), 'Message is same');
$this
->assertEquals(Direction::INCOMING, $message
->getDirection(), 'Message is incoming');
}