You are here

protected function ApigeeMockApiClientHelperTrait::createDeveloperApp in Apigee Edge 8

Helper to create a DeveloperApp entity.

Return value

\Drupal\apigee_edge\Entity\DeveloperAppInterface A DeveloperApp entity.

Throws

\Drupal\Core\Entity\EntityStorageException

8 calls to ApigeeMockApiClientHelperTrait::createDeveloperApp()
EdgeEntityAddProductEventTest::testEvent in modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityAddProductEventTest.php
Tests add_member events for Edge entities.
EdgeEntityDeleteEventTest::testEvent in modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityDeleteEventTest.php
Tests delete events for Edge entities.
EdgeEntityInsertEventTest::testEvent in modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityInsertEventTest.php
Tests insert events for Edge entities.
EdgeEntityRemoveProductEventTest::testEvent in modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityRemoveProductEventTest.php
Tests add_member events for Edge entities.
EdgeEntityUpdateEventTest::testEvent in modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityUpdateEventTest.php
Tests update events for Edge entities.

... See full list

1 method overrides ApigeeMockApiClientHelperTrait::createDeveloperApp()
ApigeeEdgeFunctionalTestTrait::createDeveloperApp in tests/src/Traits/ApigeeEdgeFunctionalTestTrait.php
Creates an app for a user.

File

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

Class

ApigeeMockApiClientHelperTrait
Helper functions working with Apigee tests.

Namespace

Drupal\Tests\apigee_mock_api_client\Traits

Code

protected function createDeveloperApp() : DeveloperAppInterface {
  static $appId;
  $appId = $appId ? $appId++ : 1;
  $this
    ->queueDeveloperResponse($this->account);

  /** @var \Drupal\apigee_edge\Entity\DeveloperAppInterface $entity */
  $entity = DeveloperApp::create([
    'appId' => $this->integration_enabled ? NULL : $appId,
    'name' => $this
      ->randomMachineName(),
    'status' => App::STATUS_APPROVED,
    'displayName' => $this
      ->randomMachineName(),
  ]);
  $entity
    ->setOwner($this->account);
  $this
    ->queueDeveloperAppResponse($entity);
  $entity
    ->save();
  return $entity;
}