You are here

public function EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti in Open Social 8.7

Same name and namespace in other branches
  1. 8.9 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti()
  2. 8.3 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti()
  3. 8.4 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti()
  4. 8.5 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti()
  5. 8.6 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti()
  6. 8.8 tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti()
  7. 10.3.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti()
  8. 10.0.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti()
  9. 10.1.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti()
  10. 10.2.x tests/behat/features/bootstrap/EmailContext.php \Drupal\social\Behat\EmailContext::iShouldHaveAnEmailWithTitleAndBodyMulti()

I read an email with multiple content.

@Then I should have an email with subject :arg1 and in the content:

File

tests/behat/features/bootstrap/EmailContext.php, line 200

Class

EmailContext

Namespace

Drupal\social\Behat

Code

public function iShouldHaveAnEmailWithTitleAndBodyMulti($subject, TableNode $table) {
  $body = [];
  $hash = $table
    ->getHash();
  foreach ($hash as $row) {
    $body[] = $row['content'];
  }
  $found_email = $this
    ->findSubjectAndBody($subject, $body);
  if (!$found_email) {
    throw new \Exception('There is no email with that subject and body.');
  }
}