Moodle APIs 4.1
Moodle 4.1.9+ (Build: 20240402)
Public Member Functions | Public Attributes | List of all members
behat_enrol Class Reference
Inheritance diagram for behat_enrol:

Public Member Functions

 getSession ($name=null)
 Returns the Mink session.
 
 i_add_enrolment_method_for_with (string $enrolmethod, string $courseidentifier, TableNode $table)
 Add the specified enrolment method to the specified course filling the form with the provided data.
 
 i_enrol_user_as ($userfullname, $rolename)
 Enrols the specified user in the current course without options.
 

Public Attributes

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

Member Function Documentation

◆ 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.

◆ i_add_enrolment_method_for_with()

behat_enrol::i_add_enrolment_method_for_with ( string  $enrolmethod,
string  $courseidentifier,
TableNode  $table 
)

Add the specified enrolment method to the specified course filling the form with the provided data.

@Given /^I add "(?P<enrolment_method_name_string>(?:[^"]|::")*)" enrolment method in "(?P<course_identifier_string>(?:[^"]|")*)" with:$/

Parameters
string$enrolmethodThe enrolment method being used
string$courseidentifierThe courseidentifier such as short name
TableNode$tableEnrolment details

◆ i_enrol_user_as()

behat_enrol::i_enrol_user_as (   $userfullname,
  $rolename 
)

Enrols the specified user in the current course without options.

This is a simple step, to set enrolment options would be better to create a separate step as a TableNode will be required.

@Given /^I enrol "(?P<user_fullname_string>(?:[^"]|::")*)" user as "(?P<rolename_string>(?:[^"]|")*)"$/

Parameters
string$userfullname
string$rolename

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: