ProcessHelper
in package
Define some utility functions for running subprocesses as part of an end-to-end test.
Table of Contents
Methods
- findCommand() : null|string
- Determine full path to an external command (by searching PATH).
- formatOutput() : string
- isShellScript() : bool
- Determine if $file is a shell script.
- run() : void
- runOk() : string
- Run a command. Assert that it succeeds. Otherwise, throw an exception.
Methods
findCommand()
Determine full path to an external command (by searching PATH).
public
static findCommand(string $name) : null|string
Parameters
- $name : string
Return values
null|stringformatOutput()
public
static formatOutput(string $cmd, string|null $stdout, string|null $stderr, int|null $exit) : string
Parameters
- $cmd : string
- $stdout : string|null
- $stderr : string|null
- $exit : int|null
Return values
stringisShellScript()
Determine if $file is a shell script.
public
static isShellScript(string $file) : bool
Parameters
- $file : string
Return values
boolrun()
public
static run(string $cmd, string|null &$stdout, string|null &$stderr, int|null &$exit) : void
Parameters
- $cmd : string
- $stdout : string|null
- $stderr : string|null
- $exit : int|null
runOk()
Run a command. Assert that it succeeds. Otherwise, throw an exception.
public
static runOk(string $cmd) : string
If the env-var DEBUG is set, then print debug information.
Parameters
- $cmd : string
Return values
string —Upon success, this is the command-output.