From 6d361c30a5888ffa5f87fd3946f619696540eebd Mon Sep 17 00:00:00 2001 From: Shishir Suvarna Date: Mon, 20 Nov 2023 10:58:47 +0530 Subject: [PATCH] Added developer queue --- .../ApigeeX/TeamInvitationsTest.php | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamInvitationsTest.php b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamInvitationsTest.php index 10fc675d..42f3d05d 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamInvitationsTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/ApigeeX/TeamInvitationsTest.php @@ -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); + } } } } @@ -167,6 +172,7 @@ public function testMultipleInvitations() { $this->queueAppGroupsResponse($appgroups); $this->queueAppGroupsResponse($appgroups); + $this->queueDevsInCompanyResponse([]); $this->submitForm([ 'developers' => $this->accountUser->getEmail(), ], 'Invite members'); @@ -176,6 +182,7 @@ public function testMultipleInvitations() { '@team' => $team->label(), '@team_label' => mb_strtolower($team->getEntityType()->getSingularLabel()), ]); + $this->assertSession()->pageTextContains($successMessage); $inCache = TRUE; } @@ -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()); } }