Code Duplication    Length = 6-6 lines in 2 locations

src/Drupal/DrupalExtension/Context/DrupalContext.php 2 locations

@@ 56-61 (lines=6) @@
53
54
      $roles = explode(',', $role);
55
      $roles = array_map('trim', $roles);
56
      foreach ($roles as $role) {
57
        if (!in_array(strtolower($role), array('authenticated', 'authenticated user'))) {
58
          // Only add roles other than 'authenticated user'.
59
          $this->getDriver()->userAddRole($user, $role);
60
        }
61
      }
62
63
      // Login.
64
      $this->login();
@@ 96-101 (lines=6) @@
93
94
      $roles = explode(',', $role);
95
      $roles = array_map('trim', $roles);
96
      foreach ($roles as $role) {
97
        if (!in_array(strtolower($role), array('authenticated', 'authenticated user'))) {
98
          // Only add roles other than 'authenticated user'.
99
          $this->getDriver()->userAddRole($user, $role);
100
        }
101
      }
102
103
      // Login.
104
      $this->login();