Moodle PHP Documentation 4.4
Moodle 4.4.9+ (Build: 20250706) (82fb415b695)
behat_email Class Reference
Inheritance diagram for behat_email:
behat_base behat_session_interface

Public Member Functions

 email_catcher_is_configured ()
 Behat step to check if email catcher is configured.
 
 empty_email_inbox ()
 Custom Behat test to empty the email inbox.
 
 getSession ($name=null)
 Returns the Mink session.
 
 reset_after_test ()
 Clean up the email inbox after each scenario.
 
 the_following_emails_have_been_sent (TableNode $table)
 Behat step to send emails.
 
 verify_email_content (string $user, string $subject, string $content)
 Verifies the content of an email sent to a specific user and subject.
 
 verify_email_count (string $address, int $expected)
 Custom Behat test to verify the number of emails for a user.
 

Static Public Member Functions

static is_email_catcher_configured ()
 Check if email catcher is configured.
 

Public Attributes

const PAGE_READY_JS
 The JS code to check that the page is ready.
 

Detailed Description

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ email_catcher_is_configured()

behat_email::email_catcher_is_configured ( )

Behat step to check if email catcher is configured.

@Given /^an email catcher server is configured$/

◆ empty_email_inbox()

behat_email::empty_email_inbox ( )

Custom Behat test to empty the email inbox.

@When I empty the email inbox

◆ getSession()

behat_session_interface::getSession ( $name = null)
inherited

Returns the Mink session.

Parameters
string | null$namename of the session OR active session will be used
Return values
Behat::Mink::Session

Implemented in behat_form_field.

◆ is_email_catcher_configured()

static behat_email::is_email_catcher_configured ( )
static

Check if email catcher is configured.

Return values
bool

◆ reset_after_test()

behat_email::reset_after_test ( )

Clean up the email inbox after each scenario.

@AfterScenario @behat_email

◆ the_following_emails_have_been_sent()

behat_email::the_following_emails_have_been_sent ( TableNode $table)

Behat step to send emails.

@Given the following emails have been sent:

Parameters
TableNode$tableThe table of emails to send.

◆ verify_email_content()

behat_email::verify_email_content ( string $user,
string $subject,
string $content )

Verifies the content of an email sent to a specific user and subject.

@Given the email to :user with subject containing :subject should contain :content

Parameters
string$userThe user to check for.
string$subjectThe subject to check for.
string$contentThe content to check for.

◆ verify_email_count()

behat_email::verify_email_count ( string $address,
int $expected )

Custom Behat test to verify the number of emails for a user.

@Then user :address should have :count emails

Parameters
string$addressThe user to check for.
int$expectedThe number of emails to check for.

Member Data Documentation

◆ PAGE_READY_JS

const behat_session_interface::PAGE_READY_JS
inherited
Initial value:
= "document.readyState === 'complete' && " .
"(typeof M !== 'object' || typeof M.util !== 'object' || " .
"typeof M.util.pending_js === 'undefined' || M.util.pending_js.length === 0)"

The JS code to check that the page is ready.

The document must be complete and either M.util.pending_js must be empty, or it must not be defined at all.


The documentation for this class was generated from the following file: