public function SmsFrameworkGatewayAdminTest::testIncomingGatewayEdit in SMS Framework 8
Same name and namespace in other branches
- 2.x tests/src/Functional/SmsFrameworkGatewayAdminTest.php \Drupal\Tests\sms\Functional\SmsFrameworkGatewayAdminTest::testIncomingGatewayEdit()
- 2.1.x tests/src/Functional/SmsFrameworkGatewayAdminTest.php \Drupal\Tests\sms\Functional\SmsFrameworkGatewayAdminTest::testIncomingGatewayEdit()
Tests incoming specific features of gateway edit form.
File
- tests/
src/ Functional/ SmsFrameworkGatewayAdminTest.php, line 211
Class
- SmsFrameworkGatewayAdminTest
- Tests gateway administration user interface.
Namespace
Drupal\Tests\sms\FunctionalCode
public function testIncomingGatewayEdit() {
$gateway = $this
->createMemoryGateway([
'plugin' => 'incoming',
]);
$this
->drupalLogin($this
->drupalCreateUser([
'administer smsframework',
]));
$url = Url::fromRoute('entity.sms_gateway.edit_form')
->setRouteParameter('sms_gateway', $gateway
->id());
$this
->drupalGet($url);
// Memory gateway supports incoming messages, so the URL should display.
$this
->assertSession()
->fieldValueEquals('incoming_messages[push_path]', $gateway
->getPushIncomingPath());
$incoming_route = '/' . $this
->randomMachineName();
$edit = [
'incoming_messages[push_path]' => $incoming_route,
];
$this
->drupalPostForm(NULL, $edit, t('Save'));
// Reload the gateway, check properties modified.
$gateway = SmsGateway::load($gateway
->id());
$this
->assertEquals($incoming_route, $gateway
->getPushIncomingPath());
}