diff --git a/modules/apigee_edge_teams/tests/src/Functional/UiTest.php b/modules/apigee_edge_teams/tests/src/Functional/UiTest.php index 79a53ed3..58addc08 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/UiTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/UiTest.php @@ -152,14 +152,16 @@ protected function tearDown(): void { * Tests the UI of the team and team app entities. */ public function testUi() { - $this->teamsWorkflowTest(); - $this->teamAndTeamAppLabelTest(); + $team_name = mb_strtolower($this->getRandomGenerator()->name()); + $team_app_1_name = mb_strtolower($this->getRandomGenerator()->name()); + $this->teamsWorkflowTest($team_name, $team_app_1_name); + $this->teamAndTeamAppLabelTest($team_name, $team_app_1_name); } /** * Tests CRUD UIs of team and team app entities. */ - protected function teamsWorkflowTest() { + protected function teamsWorkflowTest($team_name, $team_app_1_name) { $this->drupalLogin($this->account); // Open team collection page. $this->drupalGet(Url::fromRoute('entity.team.collection')); @@ -167,7 +169,7 @@ protected function teamsWorkflowTest() { // Create a new team and check whether the link to the team is visible on // the listing page. $this->clickLink('Add team'); - $team_name = $team_display_name = mb_strtolower($this->getRandomGenerator()->name()); + $team_display_name = $team_name; $this->submitForm([ 'name' => $team_name, 'displayName[0][value]' => $team_display_name, @@ -223,7 +225,7 @@ protected function teamsWorkflowTest() { $this->assertSession()->pageTextContains('There are no team apps yet.'); $this->clickLink('Add team app'); - $team_app_1_name = $team_app_1_display_name = mb_strtolower($this->getRandomGenerator()->name()); + $team_app_1_display_name = $team_app_1_name; $this->submitForm([ 'name' => $team_app_1_name, 'displayName[0][value]' => $team_app_1_display_name, @@ -308,9 +310,7 @@ protected function teamsWorkflowTest() { /** * Tests the team entity label modifications. */ - protected function teamAndTeamAppLabelTest() { - $team_name = mb_strtolower($this->getRandomGenerator()->name()); - $team_app_1_name = mb_strtolower($this->getRandomGenerator()->name()); + protected function teamAndTeamAppLabelTest($team_name, $team_app_1_name) { $this->drupalLogin($this->rootUser); $this->changeEntityAliasesAndValidate($team_name, 'apigee_edge_teams.settings.team'); $this->changeEntityAliasesAndValidate($team_app_1_name, 'apigee_edge_teams.settings.team_app');