PHP Class Consolidation\Cgr\CgrTests

Inheritance: extends PHPUnit_Framework_TestCase
Show file Open project: consolidation/cgr

Protected Properties

Property Type Description
$application
$tempDir
$workDir

Public Methods

Method Description
createFixtures ( )
deleteDirContents ( string $dir ) : boolean Deletes the contents of a directory.
fileDeleteRecursive ( $dir )
setUp ( )
setUpBeforeClass ( )
tearDown ( )
tearDownAfterClass ( )
tempdir ( $baseDir = false, $prefix = '' )
testApplicationCommandStrings ( $argv, $expected ) Unit tests on the application. We parse several sets of arguments, and check to see if the generate appropriate command strings.
testApplicationCommandStringsValues ( )
testApplicationOutput ( $argv, $envArray, $expected ) Functional test using a mocked application: we call a script that echos its arguments and prints the COMPOSER_BIN_DIR environment variable.
testApplicationOutputValues ( )
testApplicationWithComposer ( ) Functional test with the real composer executable. Use cgr to require cgr, although we do so with --no-update to avoid pointlessly downloading files we do not actually need. We therefore only test to see whether the composer.json file is correctly updated; we cannot test to see if the cgr binary is correctly installed in the appropriate bin directory, as this step is not done.
testApplicationWithComposerPassthruCommand ( ) Functional test with the real composer executable. Use cgr to require cgr, although we do so with --no-update to avoid pointlessly downloading files we do not actually need. We therefore only test to see whether the composer.json file is correctly updated; we cannot test to see if the cgr binary is correctly installed in the appropriate bin directory, as this step is not done.
testFixtures ( )

Method Details

createFixtures() public method

public createFixtures ( )

deleteDirContents() static public method

This is essentially a copy of drush_delete_dir_contents().
See also: drush_delete_dir_contents()
static public deleteDirContents ( string $dir ) : boolean
$dir string The directory to delete.
return boolean FALSE on failure, TRUE if everything was deleted.

fileDeleteRecursive() static public method

static public fileDeleteRecursive ( $dir )

setUp() public method

public setUp ( )

setUpBeforeClass() static public method

static public setUpBeforeClass ( )

tearDown() public method

public tearDown ( )

tearDownAfterClass() static public method

static public tearDownAfterClass ( )

tempdir() static public method

static public tempdir ( $baseDir = false, $prefix = '' )

testApplicationCommandStrings() public method

Unit tests on the application. We parse several sets of arguments, and check to see if the generate appropriate command strings.
public testApplicationCommandStrings ( $argv, $expected )

testApplicationCommandStringsValues() public method

testApplicationOutput() public method

Functional test using a mocked application: we call a script that echos its arguments and prints the COMPOSER_BIN_DIR environment variable.
public testApplicationOutput ( $argv, $envArray, $expected )

testApplicationOutputValues() public method

testApplicationWithComposer() public method

Functional test with the real composer executable. Use cgr to require cgr, although we do so with --no-update to avoid pointlessly downloading files we do not actually need. We therefore only test to see whether the composer.json file is correctly updated; we cannot test to see if the cgr binary is correctly installed in the appropriate bin directory, as this step is not done.

testApplicationWithComposerPassthruCommand() public method

Functional test with the real composer executable. Use cgr to require cgr, although we do so with --no-update to avoid pointlessly downloading files we do not actually need. We therefore only test to see whether the composer.json file is correctly updated; we cannot test to see if the cgr binary is correctly installed in the appropriate bin directory, as this step is not done.

testFixtures() public method

public testFixtures ( )

Property Details

$application protected property

protected $application

$tempDir protected static property

protected static $tempDir

$workDir protected property

protected $workDir