You are here

protected function TeamListBuilderTest::setUp in Apigee Edge 8

Overrides ApigeeEdgeFunctionalTestBase::setUp

File

modules/apigee_edge_teams/tests/src/Functional/TeamListBuilderTest.php, line 113

Class

TeamListBuilderTest
Apigee Edge Teams list builder tests.

Namespace

Drupal\Tests\apigee_edge_teams\Functional

Code

protected function setUp() {
  parent::setUp();
  $this
    ->addOrganizationMatchedResponse();
  $this->teamStorage = $this->entityTypeManager
    ->getStorage('team');
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('apigee_edge_teams.team_settings');
  $config
    ->set('cache_expiration', 300);
  $config
    ->save(TRUE);

  // Create accounts: user 1, for members of two teams, and an extra one.
  $this->account = $this->rootUser;
  $this->aMemberAccount = $this
    ->createNewAccount();
  $this->bMemberAccount = $this
    ->createNewAccount();
  $this->cMemberAccount = $this
    ->createNewAccount();
  $this->customRole = $this
    ->drupalCreateRole([
    'view any team',
  ]);

  // Create teams.
  $this->teamA = $this
    ->createTeam();
  $this->teamB = $this
    ->createTeam();

  // Add accounts to teams.
  $this
    ->addUserToTeam($this->teamA, $this->aMemberAccount);
  $this
    ->addUserToTeam($this->teamB, $this->bMemberAccount);
}