PHP Class Elgg\CommitMessageGitHookTest

Inheritance: extends TestCase
Show file Open project: elgg/elgg

Protected Properties

Property Type Description
$filesDir
$scriptsDir
$validateScript

Public Methods

Method Description
setUp ( )
testAcceptsValidFileInput ( )
testAcceptsValidPipeInput ( )
testAcceptsValidStringInput ( )
testRejectsEmptyFileInput ( )
testRejectsEmptyPipeInput ( )
testRejectsEmptyStringInput ( ) Test failures for missing input
testRejectsInvalidFileInput ( )

Protected Methods

Method Description
runCmd ( string $cmd, string &$output, array $env = [] ) : boolean Executes a command and returns true if the cmd exited with 0.

Method Details

runCmd() protected method

Executes a command and returns true if the cmd exited with 0.
protected runCmd ( string $cmd, string &$output, array $env = [] ) : boolean
$cmd string Shell command to execute
$output string Output from stdout and stderr will be written to this variable
$env array Array of environment variables to be passed to sub-process
return boolean Result depending on process exit code.

setUp() public method

public setUp ( )

testAcceptsValidFileInput() public method

testAcceptsValidPipeInput() public method

testAcceptsValidStringInput() public method

testRejectsEmptyFileInput() public method

testRejectsEmptyPipeInput() public method

testRejectsEmptyStringInput() public method

Test failures for missing input

testRejectsInvalidFileInput() public method

Property Details

$filesDir protected property

protected $filesDir

$scriptsDir protected property

protected $scriptsDir

$validateScript protected property

protected $validateScript