You are here

protected function DeveloperAppFieldTest::submitBaseFieldConfigForm in Apigee Edge 8

Saves the developer app's base field config form.

Parameters

bool $description_required: Whether the description must be required.

bool $callback_url_required: Whether the callback url must be required.

bool $expect_success: Whether to expect success or a validation error.

1 call to DeveloperAppFieldTest::submitBaseFieldConfigForm()
DeveloperAppFieldTest::requiredFieldTest in tests/src/Functional/DeveloperAppFieldTest.php
Tests settings base fields required.

File

tests/src/Functional/DeveloperAppFieldTest.php, line 476

Class

DeveloperAppFieldTest
Fieldable developer app test.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

protected function submitBaseFieldConfigForm(bool $description_required = FALSE, bool $callback_url_required = FALSE, bool $expect_success = TRUE) {
  $this
    ->drupalPostForm(Url::fromRoute('entity.developer_app.field_ui_fields'), [
    'table[description][required]' => $description_required,
    'table[callbackUrl][required]' => $callback_url_required,
  ], 'Save');
  if ($expect_success) {
    $this
      ->assertSession()
      ->pageTextContains('Field settings have been saved successfully.');
  }
  else {
    $this
      ->assertSession()
      ->pageTextContains('is hidden on the default form display.');
  }
}