PHP Class FUnit\TestSuite

Show file Open project: funkatron/funit Class Usage Examples

Public Properties

Property Type Description
$after_func
$before_func
$current_test_name
$errors
$exit_code
$fixtures
$name
$run
$setup_func
$teardown_func
$tests

Public Methods

Method Description
__construct ( $name = FUnit::DEFAULT_SUITE_NAME )
addAssertionResult ( $func_name, $func_args, $result, $file, $line, $fail_info, $msg = null, $expected_fail = false )
addErrorData ( $edata )
addTest ( $name, Closure $test )
after ( Closure $after ) stuff that runs after the suite begins. Triggered by run()
assertCounts ( $test_name = null ) : array
before ( Closure $before ) stuff that runs before the suite begins. Triggered by run()
fixture ( $key, $val = null )
getExitCode ( ) : integer If any test fails, the exit code will be set to 1. Otherwise 0
getName ( )
getTests ( )
resetFixtures ( )
run ( string $filter = null ) : array runs the suite and returns test results
runTest ( $name ) : [type]
runTests ( $filter = null ) : [type]
setup ( Closure $setup )
teardown ( Closure $teardown )
testCounts ( ) : array

Method Details

__construct() public method

public __construct ( $name = FUnit::DEFAULT_SUITE_NAME )

addAssertionResult() public method

See also: FUnit::add_assertion_result()
public addAssertionResult ( $func_name, $func_args, $result, $file, $line, $fail_info, $msg = null, $expected_fail = false )

addErrorData() public method

See also: FUnit::add_error_data()
public addErrorData ( $edata )

addTest() public method

See also: FUnit::add_test()
public addTest ( $name, Closure $test )
$test Closure

after() public method

stuff that runs after the suite begins. Triggered by run()
public after ( Closure $after )
$after Closure

assertCounts() public method

See also: FUnit::assertion_stats()
public assertCounts ( $test_name = null ) : array
return array

before() public method

stuff that runs before the suite begins. Triggered by run()
public before ( Closure $before )
$before Closure

fixture() public method

public fixture ( $key, $val = null )

getExitCode() public method

If any test fails, the exit code will be set to 1. Otherwise 0
public getExitCode ( ) : integer
return integer 0 or 1

getName() public method

public getName ( )

getTests() public method

public getTests ( )

resetFixtures() public method

public resetFixtures ( )

run() public method

runs the suite and returns test results
public run ( string $filter = null ) : array
$filter string
return array

runTest() public method

See also: FUnit::run_test()
public runTest ( $name ) : [type]
return [type]

runTests() public method

See also: FUnit::run_tests()
public runTests ( $filter = null ) : [type]
return [type]

setup() public method

See also: FUnit::setup()
public setup ( Closure $setup )
$setup Closure

teardown() public method

See also: FUnit::teardown()
public teardown ( Closure $teardown )
$teardown Closure

testCounts() public method

See also: FUnit::test_stats()
public testCounts ( ) : array
return array

Property Details

$after_func public property

public $after_func

$before_func public property

public $before_func

$current_test_name public property

public $current_test_name

$errors public property

public $errors

$exit_code public property

public $exit_code

$fixtures public property

public $fixtures

$name public property

public $name

$run public property

public $run

$setup_func public property

public $setup_func

$teardown_func public property

public $teardown_func

$tests public property

public $tests