You are here

protected function ApigeeMockApiClientHelperTrait::addDeveloperMatchedResponse in Apigee Edge 8

Add matched developer response.

Parameters

\Drupal\user\UserInterface $developer: The developer user to get properties from.

File

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

Class

ApigeeMockApiClientHelperTrait
Helper functions working with Apigee tests.

Namespace

Drupal\Tests\apigee_mock_api_client\Traits

Code

protected function addDeveloperMatchedResponse(UserInterface $developer) {
  $organization = $this->sdkConnector
    ->getOrganization();
  $dev = new Developer([
    'email' => $developer
      ->getEmail(),
    'developerId' => $developer
      ->uuid(),
    'firstName' => $developer->first_name->value,
    'lastName' => $developer->last_name->value,
    'userName' => $developer
      ->getAccountName(),
    'organizationName' => $organization,
  ]);
  $this->stack
    ->on(new RequestMatcher("/v1/organizations/{$organization}/developers/{$developer->getEmail()}\$", NULL, [
    'GET',
  ]), $this->mockResponseFactory
    ->generateResponse(new ApigeeSdkEntitySource($developer)));
}