public function SmsFrameworkGatewayAdminTest::testFallbackGateway in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Functional/SmsFrameworkGatewayAdminTest.php \Drupal\Tests\sms\Functional\SmsFrameworkGatewayAdminTest::testFallbackGateway()
- 2.1.x tests/src/Functional/SmsFrameworkGatewayAdminTest.php \Drupal\Tests\sms\Functional\SmsFrameworkGatewayAdminTest::testFallbackGateway()
Tests setting up the fallback gateway.
File
- tests/
src/ Functional/ SmsFrameworkGatewayAdminTest.php, line 66
Class
- SmsFrameworkGatewayAdminTest
- Tests gateway administration user interface.
Namespace
Drupal\Tests\sms\FunctionalCode
public function testFallbackGateway() {
$test_gateway = $this
->createMemoryGateway([
'skip_queue' => TRUE,
]);
// Test initial fallback gateway.
$sms_gateway_fallback = SmsGateway::load($this
->config('sms.settings')
->get('fallback_gateway'));
$this
->assertEqual($sms_gateway_fallback
->id(), 'log', 'Initial fallback gateway is "log".');
$this
->drupalLogin($this
->drupalCreateUser([
'administer smsframework',
]));
// Change fallback gateway.
$this
->drupalPostForm(Url::fromRoute('sms.settings'), [
'fallback_gateway' => $test_gateway
->id(),
], 'Save configuration');
$this
->assertResponse(200);
$sms_gateway_fallback = SmsGateway::load($this
->config('sms.settings')
->get('fallback_gateway'));
$this
->assertEqual($sms_gateway_fallback
->id(), $test_gateway
->id(), 'Fallback gateway changed.');
}