You are here

protected function DeveloperAppFieldTest::assertFieldVisibleOnEntityForm in Apigee Edge 8

Asserts whether a field is visible on the entity form.

Parameters

string $field_label: Label of the field.

bool $visible: Whether it should be visible or not.

1 call to DeveloperAppFieldTest::assertFieldVisibleOnEntityForm()
DeveloperAppFieldTest::formRegionTest in tests/src/Functional/DeveloperAppFieldTest.php
Tests form regions.

File

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

Class

DeveloperAppFieldTest
Fieldable developer app test.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

protected function assertFieldVisibleOnEntityForm(string $field_label, bool $visible = TRUE) {
  $this
    ->drupalGet(Url::fromRoute('entity.developer_app.add_form_for_developer', [
    'user' => $this->account
      ->id(),
  ]));
  $this
    ->assertEquals(Response::HTTP_OK, $this
    ->getSession()
    ->getStatusCode());
  if ($visible) {
    $this
      ->assertSession()
      ->pageTextContains($field_label);
  }
  else {
    $this
      ->assertSession()
      ->pageTextNotContains($field_label);
  }
}