Step definitions
Each step requires a corresponding callback function called a step definition. A step definition is written in PHP and consists of a keyword, a regular expression, and a callback. You may need to add your own step definitions (Behat will throw an error if a step definition is missing). There are examples of custom step definitions in Moodle core, for example, in the learning plan (lp) admin tool. Use Eclipse to search the code for behat_base, the class on which all custom step definitions are based.
This section is intended only to give an overview of Moodle testing with Behat. For more details, log in to your development Moodle, and from the Site administration menu, click on Development and select Acceptance testing:
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access