You are here

protected function ApigeeMockApiClientHelperTrait::queueDeveloperAppResponse in Apigee Edge 8

Helper to add Edge entity response to stack.

Parameters

\Drupal\apigee_edge\Entity\DeveloperAppInterface $app: The app.

int $response_code: Response code, defaults to 200.

array $credentials: An array of app credentials.

16 calls to ApigeeMockApiClientHelperTrait::queueDeveloperAppResponse()
ApigeeMockApiClientHelperTrait::createDeveloperApp in tests/modules/apigee_mock_api_client/tests/src/Traits/ApigeeMockApiClientHelperTrait.php
Helper to create a DeveloperApp entity.
AppListBuilderTest::setUp in tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php
AppWarningsCheckerTest::setUp in tests/src/Kernel/Entity/AppWarningsCheckerTest.php
DeveloperAppAnalyticsTest::setUp in tests/src/Functional/DeveloperAppAnalyticsTest.php
DeveloperAppAnalyticsTest::testAnalytics in tests/src/Functional/DeveloperAppAnalyticsTest.php
Tests the analytics page with the logged in developer app owner.

... See full list

File

tests/modules/apigee_mock_api_client/tests/src/Traits/ApigeeMockApiClientHelperTrait.php, line 332

Class

ApigeeMockApiClientHelperTrait
Helper functions working with Apigee tests.

Namespace

Drupal\Tests\apigee_mock_api_client\Traits

Code

protected function queueDeveloperAppResponse(DeveloperAppInterface $app, $response_code = 200, array $credentials = []) {
  $this->stack
    ->queueMockResponse([
    'get_developer_app' => [
      'status_code' => $response_code,
      'app' => [
        'appId' => $app
          ->getAppId() ?: $this
          ->randomMachineName(),
        'name' => $app
          ->getName(),
        'status' => $app
          ->getStatus(),
        'displayName' => $app
          ->getDisplayName(),
        'developerId' => $app
          ->getDeveloperId(),
      ],
      'credentials' => $credentials,
    ],
  ]);
}