Skip to content

Commit

Permalink
Added developer queue
Browse files Browse the repository at this point in the history
  • Loading branch information
shishir-intelli committed Nov 20, 2023
1 parent e14656a commit 6d361c3
Showing 1 changed file with 31 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,32 +106,37 @@ protected function setUp(): void {
* {@inheritdoc}
*/
protected function tearDown(): void {
$teams = [
$this->teamA,
$this->teamB,
];
foreach ($teams as $team) {
if ($team !== NULL) {
try {
$team->delete();
}
catch (\Exception $exception) {
$this->logException($exception);
if (!$this->integration_enabled) {
return;
}
else {
$teams = [
$this->teamA,
$this->teamB,
];
foreach ($teams as $team) {
if ($team !== NULL) {
try {
$team->delete();
}
catch (\Exception $exception) {
$this->logException($exception);
}
}
}
}

$accounts = [
$this->accountAdmin,
$this->accountUser,
];
foreach ($accounts as $account) {
if ($account !== NULL) {
try {
$account->delete();
}
catch (\Exception $exception) {
$this->logException($exception);
$accounts = [
$this->accountAdmin,
$this->accountUser,
];
foreach ($accounts as $account) {
if ($account !== NULL) {
try {
$account->delete();
}
catch (\Exception $exception) {
$this->logException($exception);
}
}
}
}
Expand Down Expand Up @@ -167,6 +172,7 @@ public function testMultipleInvitations() {

$this->queueAppGroupsResponse($appgroups);
$this->queueAppGroupsResponse($appgroups);
$this->queueDevsInCompanyResponse([]);
$this->submitForm([
'developers' => $this->accountUser->getEmail(),
], 'Invite members');
Expand All @@ -176,6 +182,7 @@ public function testMultipleInvitations() {
'@team' => $team->label(),
'@team_label' => mb_strtolower($team->getEntityType()->getSingularLabel()),
]);

$this->assertSession()->pageTextContains($successMessage);
$inCache = TRUE;
}
Expand Down Expand Up @@ -219,20 +226,11 @@ public function testInvitationsList() {
]);

$this->queueAppGroupsResponse($appgroups);
$this->queueDevsInCompanyResponse([]);
$this->drupalGet($invitationsUrl);
foreach ($teams as $team) {
$this->assertSession()->pageTextContains('Invitation to join ' . $team->label());
}

// Delete a team and ensure related team invitation was deleted too.
$this->queueAppGroupResponse($this->teamA->decorated());
$teamALabel = $this->teamA->label();
$this->teamA->delete();
$this->queueAppGroupsResponse($appgroups);
$this->queueAppGroupResponse($this->teamB->decorated());
$this->drupalGet($invitationsUrl);
$this->assertSession()->pageTextNotContains('Invitation to join ' . $teamALabel);
$this->assertSession()->pageTextContains('Invitation to join ' . $this->teamB->label());
}

}

0 comments on commit 6d361c3

Please sign in to comment.