Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Static Public Member Functions | Public Attributes | Static Protected Member Functions | List of all members
behat_command Class Reference

Static Public Member Functions

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

Public Attributes

const DOCS_URL = 'https://docs.moodle.org/dev/Running_acceptance_test'
 Docs url.
 

Static Protected Member Functions

static output_msg ($msg)
 Outputs a message. More...
 

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: