Code Duplication    Length = 7-7 lines in 3 locations

src/Drupal/DrupalExtension/Context/MessageContext.php 1 location

@@ 248-254 (lines=7) @@
245
   * @param $name
246
   *   string CSS selector name
247
   */
248
  public function getDrupalSelector($name) {
249
    $text = $this->getDrupalParameter('selectors');
250
    if (!isset($text[$name])) {
251
      throw new \Exception(sprintf('No such selector configured: %s', $name));
252
    }
253
    return $text[$name];
254
  }
255
256
  /**
257
   * Internal callback to check for a specific message in a given context.

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

@@ 141-147 (lines=7) @@
138
   * @throws \Exception
139
   * @return
140
   */
141
  public function getDrupalText($name) {
142
    $text = $this->getDrupalParameter('text');
143
    if (!isset($text[$name])) {
144
      throw new \Exception(sprintf('No such Drupal string: %s', $name));
145
    }
146
    return $text[$name];
147
  }
148
149
  /**
150
   * Returns a specific css selector.
@@ 155-161 (lines=7) @@
152
   * @param $name
153
   *   string CSS selector name
154
   */
155
  public function getDrupalSelector($name) {
156
    $text = $this->getDrupalParameter('selectors');
157
    if (!isset($text[$name])) {
158
      throw new \Exception(sprintf('No such selector configured: %s', $name));
159
    }
160
    return $text[$name];
161
  }
162
163
  /**
164
   * Get active Drupal Driver.