You are here

protected function TeamMembershipManagerTest::setUp in Apigee Edge 8

Overrides ApigeeEdgeFunctionalTestBase::setUp

File

modules/apigee_edge_teams/tests/src/Functional/TeamMembershipManagerTest.php, line 61

Class

TeamMembershipManagerTest
Team membership manager service test.

Namespace

Drupal\Tests\apigee_edge_teams\Functional

Code

protected function setUp() {
  parent::setUp();
  $this->developerStorage = $this->container
    ->get('entity_type.manager')
    ->getStorage('developer');
  $this->teamStorage = $this->container
    ->get('entity_type.manager')
    ->getStorage('team');
  for ($i = 0; $i < 2; $i++) {
    $name = strtolower($this
      ->randomMachineName());

    /** @var \Drupal\apigee_edge\Entity\DeveloperInterface $developer */
    $developer = $this->developerStorage
      ->create([
      'email' => $name . '@example.com',
      'userName' => $name,
      'firstName' => $this
        ->getRandomGenerator()
        ->word(8),
      'lastName' => $this
        ->getRandomGenerator()
        ->word(8),
    ]);
    $developer
      ->save();
    $this->developers[$i] = $developer;
  }
  $this->team = $this->teamStorage
    ->create([
    'name' => $this
      ->getRandomGenerator()
      ->name(),
  ]);
  $this->team
    ->save();
}