You are here

protected function DeveloperAppFieldTest::submitFormDisplay in Apigee Edge 8

Saves the developer app's form display settings.

Parameters

array $region_overrides: Which field's regions should be changed. Key is the field name, value is the region.

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

2 calls to DeveloperAppFieldTest::submitFormDisplay()
DeveloperAppFieldTest::formRegionTest in tests/src/Functional/DeveloperAppFieldTest.php
Tests form regions.
DeveloperAppFieldTest::requiredFieldTest in tests/src/Functional/DeveloperAppFieldTest.php
Tests settings base fields required.

File

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

Class

DeveloperAppFieldTest
Fieldable developer app test.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

protected function submitFormDisplay(array $region_overrides = [], bool $expect_success = TRUE) {
  $edit = [];
  foreach ($region_overrides as $field => $region) {
    $edit["fields[{$field}][region]"] = $region;
  }
  $this
    ->drupalPostForm(Url::fromRoute('entity.entity_form_display.developer_app.default'), $edit, 'Save');
  if ($expect_success) {
    $this
      ->assertSession()
      ->pageTextContains('Your settings have been saved.');
  }
  else {
    $this
      ->assertSession()
      ->pageTextContains('is required.');
  }
}