Skip to content

Commit

Permalink
Changes for Unittest cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kedarkhaire committed Oct 4, 2023
1 parent f89aae1 commit 2582d69
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/apigee_edge_teams/tests/src/Functional/UiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,22 +152,24 @@ 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'));

// 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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 2582d69

Please sign in to comment.