You are here

protected function DeveloperAppFieldTest::viewRegionTest in Apigee Edge 8

Tests the view regions.

1 call to DeveloperAppFieldTest::viewRegionTest()
DeveloperAppFieldTest::testFieldableDeveloperApp in tests/src/Functional/DeveloperAppFieldTest.php
Tests fieldable developer app entity.

File

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

Class

DeveloperAppFieldTest
Fieldable developer app test.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

protected function viewRegionTest() {
  $callbackUrl = 'https://' . strtolower($this
    ->randomMachineName()) . '.example.com';
  $this->developerApp
    ->setCallbackUrl($callbackUrl);
  $this->developerApp
    ->save();
  $assert = function (bool $visible = TRUE) use ($callbackUrl) {
    $this
      ->assertFieldVisibleOnEntityDisplay($this->developerApp
      ->getName(), 'Callback URL', $callbackUrl, $visible);
  };
  $this
    ->submitViewDisplay([
    'callbackUrl' => 'content',
  ]);
  $assert(TRUE);
  $this
    ->submitViewDisplay([
    'callbackUrl' => 'hidden',
  ]);
  $assert(FALSE);
}