Skip to main content

Email

DrevOps\BehatSteps\Steps\Drupal\EmailTrait - Source, Steps

Test Drupal email functionality with content verification.

public function emailCollectorIsEnabled(string $type = 'default'): bool

Check whether this scenario's collector has replaced a handler type

public function emailDisableCollector(): void

Restore the mail system of every handler type, and clear the collector

public function emailEnableCollector(): void

Switch every handler type to the test mail collector, and clear it

public static function emailExtractLinks(string $string): array

Extract all links from provided string

public function emailFindLinkContaining(string $partial_url): ?string

Find the first link in a collected email whose URL contains a value

public function emailFindMessage(string $field, PyStringNode $string, bool $is_exact = FALSE): ?array

Find an email message whose field contains a value

public function emailFindMessageBySubject(string $subject, bool $is_partial = FALSE): ?array

Find the first collected email by exact or partial subject

public function emailGetCollectedMessages(): array

Get email messages collected during the test

public function emailGetMessageBySubject(string $subject, bool $is_partial = FALSE): array

Get the first collected email by exact or partial subject

public function emailGetMessagesToAddress(string $address): array

Get the collected emails sent to an address

public function emailGetMessagesWithSubject(string $subject): array

Get the collected emails with a subject