You are here

protected function ApigeeMockApiClientHelperTrait::addOrganizationMatchedResponse in Apigee Edge 8

Add matched org response.

Parameters

string $organizationName: The organization name, or empty to use the default from the credentials.

14 calls to ApigeeMockApiClientHelperTrait::addOrganizationMatchedResponse()
AppListBuilderTest::setUp in tests/src/Kernel/Entity/ListBuilder/AppListBuilderTest.php
AppWarningsCheckerTest::setUp in tests/src/Kernel/Entity/AppWarningsCheckerTest.php
DeveloperAppApiKeysPermissionTest::setUp in tests/src/Functional/DeveloperAppApiKeysPermissionTest.php
DeveloperAppApiKeyTest::setUp in tests/src/Functional/DeveloperAppApiKeyTest.php
DeveloperTest::developerCreateByAdminTest in tests/src/Functional/DeveloperTest.php
Tests creating, editing and deleting developer entity by admin.

... See full list

File

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

Class

ApigeeMockApiClientHelperTrait
Helper functions working with Apigee tests.

Namespace

Drupal\Tests\apigee_mock_api_client\Traits

Code

protected function addOrganizationMatchedResponse($organizationName = '') {
  $organizationName = $organizationName ?: $this->sdkConnector
    ->getOrganization();
  $organization = new Organization([
    'name' => $organizationName,
  ]);
  $this->stack
    ->on(new RequestMatcher("/v1/organizations/{$organization->id()}\$", NULL, [
    'GET',
  ]), $this->mockResponseFactory
    ->generateResponse(new ApigeeSdkEntitySource($organization)));
}