Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
behat_command Class Reference

Behat command related utils. More...

Static Public Member Functions

static are_behat_dependencies_installed ()
 Has the site installed composer.
 
static behat_setup_problem ()
 Checks if behat is set up and working.
 
static get_behat_command ($custombyterm=false, $parallerun=false, $absolutepath=false)
 Returns the executable path.
 
static get_behat_dir ($runprocess=0)
 Ensures the behat dir exists in moodledata.
 
static get_parent_behat_dir ()
 Ensures the behat dir exists in moodledata.
 
static run ($options='')
 Runs behat command with provided options.
 

Public Attributes

const DOCS_URL = 'https://moodledev.io/general/development/tools/behat'
 Docs url.
 

Static Protected Member Functions

static output_msg ($msg)
 Outputs a message.
 

Detailed Description

Behat command related utils.

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

Member Function Documentation

◆ are_behat_dependencies_installed()

static behat_command::are_behat_dependencies_installed ( )
static

Has the site installed composer.

Return values
bool

◆ behat_setup_problem()

static behat_command::behat_setup_problem ( )
static

Checks if behat is set up and working.

Notifies failures both from CLI and web interface.

It checks behat dependencies have been installed and runs the behat help command to ensure it works as expected

Return values
intError code or 0 if all ok

◆ get_behat_command()

static behat_command::get_behat_command ( $custombyterm = false,
$parallerun = false,
$absolutepath = false )
staticfinal

Returns the executable path.

Allows returning a customized command for cygwin when the command is just displayed, when using exec(), system() and friends we stay with DIRECTORY_SEPARATOR as they use the normal cmd.exe (in Windows).

Parameters
bool$custombytermIf the provided command should depend on the terminal where it runs
bool$parallelrunIf parallel run is installed.
bool$absolutepathreturn command with absolute path.
Return values
string

◆ get_behat_dir()

static behat_command::get_behat_dir ( $runprocess = 0)
static

Ensures the behat dir exists in moodledata.

Parameters
int$runprocessrun process for which behat dir is returned.
Return values
stringFull path

◆ get_parent_behat_dir()

static behat_command::get_parent_behat_dir ( )
static

Ensures the behat dir exists in moodledata.

Return values
stringFull path

◆ output_msg()

static behat_command::output_msg ( $msg)
staticprotected

Outputs a message.

Used in CLI + web UI methods. Stops the execution in web.

Parameters
string$msg
Return values
void

◆ run()

static behat_command::run ( $options = '')
staticfinal

Runs behat command with provided options.

Execution continues when the process finishes

Parameters
string$optionsDefaults to '' so tests would be executed
Return values
arrayCLI command outputs [0] => string, [1] => integer

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