public function SmsDevelMessageTest::testNoFallbackGateway in SMS Framework 2.x
Same name and namespace in other branches
- 8 modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php \Drupal\Tests\sms_devel\Functional\SmsDevelMessageTest::testNoFallbackGateway()
- 2.1.x modules/sms_devel/tests/src/Functional/SmsDevelMessageTest.php \Drupal\Tests\sms_devel\Functional\SmsDevelMessageTest::testNoFallbackGateway()
Tests error shown if gateway found for message.
File
- modules/
sms_devel/ tests/ src/ Functional/ SmsDevelMessageTest.php, line 168
Class
- SmsDevelMessageTest
- Tests the message form.
Namespace
Drupal\Tests\sms_devel\FunctionalCode
public function testNoFallbackGateway() {
$this
->setFallbackGateway(NULL);
$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()
->responseContains('Message could not be sent');
$messages = $this
->getTestMessages($this->gateway);
$this
->assertEquals(0, count($messages), 'No messages sent.');
}