You are here

protected function ApigeeMockApiClientHelperTrait::queueCompaniesResponse in Apigee Edge 8

Queues up a mock companies response.

Parameters

array $companies: An array of company objects.

string|null $response_code: Add a response code to override the default.

3 calls to ApigeeMockApiClientHelperTrait::queueCompaniesResponse()
TeamInvitationsTest::testInvitationsList in modules/apigee_edge_teams/tests/src/Functional/TeamInvitationsTest.php
Tests that a user can see their list of invitations.
TeamInvitationsTest::testMultipleInvitations in modules/apigee_edge_teams/tests/src/Functional/TeamInvitationsTest.php
Tests that an email can be invited to one or more teams.
TeamListBuilderTest::testTeamListCache in modules/apigee_edge_teams/tests/src/Functional/TeamListBuilderTest.php
Tests team list cache.

File

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

Class

ApigeeMockApiClientHelperTrait
Helper functions working with Apigee tests.

Namespace

Drupal\Tests\apigee_mock_api_client\Traits

Code

protected function queueCompaniesResponse(array $companies, $response_code = NULL) {
  $context = empty($response_code) ? [] : [
    'status_code' => $response_code,
  ];
  $context['companies'] = $companies;
  $this->stack
    ->queueMockResponse([
    'companies' => $context,
  ]);
}