Skip to content

Commit

Permalink
Minor syntax fixes on FeatureContext.php
Browse files Browse the repository at this point in the history
  • Loading branch information
arismag authored Mar 12, 2024
1 parent 912ddb3 commit e57c3ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/Behat/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* Defines step definitions that are generally useful for the project.
*/
class FeatureContext extends RawDrupalContext {

/**
* Checks that a 403 Access Denied error occurred.
*
Expand Down Expand Up @@ -62,6 +61,7 @@ public function createProfile($name, TableNode $usersTable)
'type' => 'member',
'uid' => key($user),
]);

// Set field values for profile.
$term_ids = [];
foreach ($table as $key => $value) {
Expand All @@ -77,6 +77,7 @@ public function createProfile($name, TableNode $usersTable)
$profile->set($key, $term_ids);
}
}

// Set the country and city values.
$address_values = [
'locality' => 'Mountain View',
Expand All @@ -94,7 +95,6 @@ public function createProfile($name, TableNode $usersTable)
* @Given there is a group with data:
*/
public function createGroup(TableNode $usersTable) {

// Get all values from table.
$fields = $usersTable->getRow(0);
$values = $usersTable->getRow(1);
Expand All @@ -106,6 +106,7 @@ public function createGroup(TableNode $usersTable) {
$term = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties(['name' => $topic]);
$term_ids[] = key($term);
}

// Create group.
$group = Group::create([
'label' => $table['title'],
Expand All @@ -117,6 +118,7 @@ public function createGroup(TableNode $usersTable) {
'moderation_state' => $table['moderation_state'],
'author' => $table['author']
]);

// Save the group entity.
$group->save();
}
Expand Down

0 comments on commit e57c3ec

Please sign in to comment.