You are here

protected function ApigeeMockApiClientHelperTrait::createTeam in Apigee Edge 8

Helper to create a Team entity.

Return value

\Drupal\apigee_edge_teams\Entity\TeamInterface A Team entity.

Throws

\Drupal\Core\Entity\EntityStorageException

6 calls to ApigeeMockApiClientHelperTrait::createTeam()
EdgeEntityAddMemberEventTest::testEvent in modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityAddMemberEventTest.php
Tests add_member events for Edge entities.
EdgeEntityRemoveMemberEventTest::testEvent in modules/apigee_edge_actions/tests/src/Kernel/Plugin/RulesEvent/EdgeEntityRemoveMemberEventTest.php
Tests add_member events for Edge entities.
TeamInvitationEventsTest::testEvents in modules/apigee_edge_teams/tests/src/Kernel/Event/TeamInvitationEventsTest.php
Tests team_invitation events.
TeamInvitationsTest::setUp in modules/apigee_edge_teams/tests/src/Functional/TeamInvitationsTest.php
TeamListBuilderTest::setUp in modules/apigee_edge_teams/tests/src/Functional/TeamListBuilderTest.php

... See full list

File

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

Class

ApigeeMockApiClientHelperTrait
Helper functions working with Apigee tests.

Namespace

Drupal\Tests\apigee_mock_api_client\Traits

Code

protected function createTeam() : TeamInterface {

  /** @var \Drupal\apigee_edge_teams\Entity\TeamInterface $team */
  $team = Team::create([
    'name' => $this
      ->randomMachineName(),
    'displayName' => $this->randomGenerator
      ->name(),
  ]);
  $this
    ->queueCompanyResponse($team
    ->decorated());
  $this->stack
    ->queueMockResponse('no_content');
  $team
    ->save();
  return $team;
}