You are here

protected function CacheTest::editAppIsAlwaysUncachedTest in Apigee Edge 8

Tests that developer app edit form is always uncached.

1 call to CacheTest::editAppIsAlwaysUncachedTest()
CacheTest::testCache in tests/src/FunctionalJavascript/CacheTest.php
Tests cache of Apigee Edge entities.

File

tests/src/FunctionalJavascript/CacheTest.php, line 180

Class

CacheTest
Apigee Edge entity cache related tests.

Namespace

Drupal\Tests\apigee_edge\FunctionalJavascript

Code

protected function editAppIsAlwaysUncachedTest() {

  /** @var \Drupal\apigee_edge\SDKConnectorInterface $connector */
  $connector = $this->container
    ->get('apigee_edge.sdk_connector');
  $controller = new DeveloperAppController($connector
    ->getOrganization(), $this->developer
    ->getDeveloperId(), $connector
    ->getClient());
  $name = strtolower($this
    ->randomMachineName(16));

  /** @var \Apigee\Edge\Api\Management\Entity\DeveloperApp $developer_app */
  $developer_app = $controller
    ->load($this->developerApp
    ->getName());
  $developer_app
    ->setDisplayName($name);
  $controller
    ->update($developer_app);
  $this
    ->drupalGet(Url::fromRoute('entity.developer_app.edit_form_for_developer', [
    'user' => $this->account
      ->id(),
    'app' => $developer_app
      ->getName(),
  ]));
  $this
    ->assertSession()
    ->fieldValueEquals('displayName[0][value]', $name);

  // Submit the form to clear render caches.
  $this
    ->submitForm([], 'Save');

  // Update the label of the "cached" developer app entity so the next
  // warmCaches() method call could find the related link to that on the
  // Apps page.
  $this->developerApp
    ->setDisplayName($developer_app
    ->getDisplayName());
}