You are here

public function DeveloperAppAnalyticsTest::testAnalytics in Apigee Edge 8

Tests the analytics page with the logged in developer app owner.

File

tests/src/Functional/DeveloperAppAnalyticsTest.php, line 126

Class

DeveloperAppAnalyticsTest
Developer app analytics test.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

public function testAnalytics() {
  $this
    ->drupalLogin($this->account);
  $path = Url::fromRoute('entity.developer_app.analytics_for_developer', [
    'user' => $this->account
      ->id(),
    'app' => $this->developerApp
      ->getName(),
  ])
    ->toString();

  // App is loaded once and then saved into cache, so the mock
  // developerApp response only needs to be added once.
  $this
    ->queueDeveloperAppResponse($this->developerApp);
  $this
    ->visitAnalyticsPage($path);
  $this
    ->visitAnalyticsPage($path, TRUE);
  $path = Url::fromRoute('entity.developer_app.analytics', [
    'developer_app' => $this->developerApp
      ->id(),
  ])
    ->toString();
  $this
    ->visitAnalyticsPage($path);
  $this
    ->visitAnalyticsPage($path, TRUE);
  $this
    ->exportAnalyticsTest();
}