You are here

public function SmsFrameworkGatewayAdminTest::testNoIncomingFields in SMS Framework 2.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/SmsFrameworkGatewayAdminTest.php \Drupal\Tests\sms\Functional\SmsFrameworkGatewayAdminTest::testNoIncomingFields()
  2. 2.1.x tests/src/Functional/SmsFrameworkGatewayAdminTest.php \Drupal\Tests\sms\Functional\SmsFrameworkGatewayAdminTest::testNoIncomingFields()

Tests a gateway edit form does not contain incoming path fields.

File

tests/src/Functional/SmsFrameworkGatewayAdminTest.php, line 238

Class

SmsFrameworkGatewayAdminTest
Tests gateway administration user interface.

Namespace

Drupal\Tests\sms\Functional

Code

public function testNoIncomingFields() {
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'administer smsframework',
  ]));
  $gateway = $this
    ->createMemoryGateway([
    'plugin' => 'capabilities_default',
  ]);
  $this
    ->drupalGet(Url::fromRoute('entity.sms_gateway.edit_form', [
    'sms_gateway' => $gateway
      ->id(),
  ]));
  $this
    ->assertSession()
    ->responseContains('Edit gateway');
  $this
    ->assertSession()
    ->fieldNotExists('incoming_messages[push_path]');
  $this
    ->assertSession()
    ->responseContains(t('This gateway does not support receiving messages.'));
}