PHP Class App\Lib\Codeception

(c) James Healey For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
Show file Open project: jayhealey/webception

Public Properties

Property Type Description
$config boolean Merges the Codeception.yml and Webception Codeception.php

Public Methods

Method Description
__construct ( array $config = [], $site = NULL ) Initialization of the Codeception class.
addTest ( Test $test ) Add a Test to the list.
checkExecutable ( string $file, string $config ) : array Check that the Codeception executable exists and is runnable.
checkWriteable ( $path = null, $config ) : array Check if the Codeception Log Path is writeable.
getCommandPath ( string $type, string $filename, $env ) : string Full command to run a Codeception test.
getEnvironments ( $type )
getLogPath ( ) : string Get the Codeception log path
getRunResponse ( string $type, string $hash ) : array Given a test type & hash, handle the test run response for the AJAX call.
getTest ( string $type, string $hash ) : App\Lib\Test Given a test type & hash, return a single Test.
getTestTally ( ) : integer Return the count of discovered tests
getTests ( ) Get the complete test list.
loadConfig ( string $path, string $file ) : array Load the Codeception YAML configuration.
loadTests ( ) Load the Codeception tests from disk.
ready ( ) : boolean Return if Codeception is ready.
run ( Test $test ) : Test Given a test, run the Codeception test.

Method Details

__construct() public method

Initialization of the Codeception class.
public __construct ( array $config = [], $site = NULL )
$config array The codeception.php configuration file.

addTest() public method

Push the tally count up as well.
public addTest ( Test $test )
$test Test

checkExecutable() public method

Check that the Codeception executable exists and is runnable.
public checkExecutable ( string $file, string $config ) : array
$file string File name of the Codeception executable.
$config string Full path of the config of where the $file was defined.
return array Array of flags used in the JSON respone.

checkWriteable() public method

Check if the Codeception Log Path is writeable.
public checkWriteable ( $path = null, $config ) : array
return array Array of flags used in the JSON respone.

getCommandPath() public method

Full command to run a Codeception test.
public getCommandPath ( string $type, string $filename, $env ) : string
$type string Test Type (Acceptance, Functional, Unit)
$filename string Name of the Test
return string Full command to execute Codeception with requred parameters.

getEnvironments() public method

public getEnvironments ( $type )

getLogPath() public method

Get the Codeception log path
public getLogPath ( ) : string
return string

getRunResponse() public method

Given a test type & hash, handle the test run response for the AJAX call.
public getRunResponse ( string $type, string $hash ) : array
$type string Test type (Unit, Acceptance, Functional)
$hash string Hash of the test.
return array Array of flags used in the JSON respone.

getTest() public method

Given a test type & hash, return a single Test.
public getTest ( string $type, string $hash ) : App\Lib\Test
$type string Test type (Unit, Acceptance, Functional)
$hash string Hash of the test.
return App\Lib\Test or FALSE.

getTestTally() public method

Return the count of discovered tests
public getTestTally ( ) : integer
return integer $this->tally

getTests() public method

Get the complete test list.
public getTests ( )

loadConfig() public method

Load the Codeception YAML configuration.
public loadConfig ( string $path, string $file ) : array
$path string
$file string
return array $config

loadTests() public method

Load the Codeception tests from disk.
public loadTests ( )

ready() public method

Return if Codeception is ready.
public ready ( ) : boolean
return boolean

run() public method

Given a test, run the Codeception test.
public run ( Test $test ) : Test
$test Test Current test to Run.
return Test $test Updated test with log and result.

Property Details

$config public property

Merges the Codeception.yml and Webception Codeception.php
public bool $config
return boolean