PHP Class Tester, atk4

显示文件 Open project: atk4/atk4 Class Usage Examples

Public Properties

Property Type Description
$results Model Contains model with test results.
$single_test_only If set, it will run only a single test, useful for isolated testing.

Public Methods

Method Description
_add ( $class ) Similar to a regular Agile Toolkit add method, however will will return a "wrapper" object of a specified class. This wrapper will automatically intercept all method calls of a host object and send it to $debug.
debug ( $text ) Outputs some debug information, which is cached until the end of current test. If any of the assertions fail, this will also output debug information.
disableAsserts ( ) Restores previous setting of assert() method.
enableAsserts ( ) Configures PHP assert() method to use internal callback for error reporting.
info ( $text ) Force output of the text which will appear while the tests are being executed. This is useful if your test takes some time to perform and you would want to have some output on the console.
init ( )
prepareForTest ( $test )
setState ( $state ) Sets the state of your application.
skip ( )
verifyState ( $state ) Verifies that the state of your application matches selected.

Method Details

_add() public method

Similar to a regular Agile Toolkit add method, however will will return a "wrapper" object of a specified class. This wrapper will automatically intercept all method calls of a host object and send it to $debug.
public _add ( $class )

debug() public method

Outputs some debug information, which is cached until the end of current test. If any of the assertions fail, this will also output debug information.
public debug ( $text )

disableAsserts() public method

Restores previous setting of assert() method.
public disableAsserts ( )

enableAsserts() public method

Configures PHP assert() method to use internal callback for error reporting.
public enableAsserts ( )

info() public method

Force output of the text which will appear while the tests are being executed. This is useful if your test takes some time to perform and you would want to have some output on the console.
public info ( $text )

init() public method

public init ( )

prepareForTest() public method

public prepareForTest ( $test )

setState() public method

Sets the state of your application.
public setState ( $state )

skip() public method

public skip ( )

verifyState() public method

Verifies that the state of your application matches selected.
public verifyState ( $state )

Property Details

$results public_oe property

Contains model with test results.
public Model $results
return Model

$single_test_only public_oe property

If set, it will run only a single test, useful for isolated testing.
public $single_test_only