Constants

P_NAME

P_NAME

Defines a parameter as "name"

P_ARGS

P_ARGS

Defines a parameter as "arguments"

P_OUTCOME

P_OUTCOME

Defines a parameter as "expected outcome"

P_TYPE

P_TYPE

Defines a parameter as "type"

P_DEFINITION

P_DEFINITION

Defines a parameter as "definition"

P_PASSED

P_PASSED

Defines a parameter as "passed"

T_OUTPUT

T_OUTPUT

Defines the test type as "output test"

T_RETURN

T_RETURN

Defines the test type as "return test"

O_NOT_CALLABLE

O_NOT_CALLABLE

Defines an outcome as "method/function not callable"

P_TEST_START

P_TEST_START

Defines a parameter as "start of test"

P_TEST_END

P_TEST_END

Defines a parameter as "end of test"

P_TEST_RUNTIME

P_TEST_RUNTIME

Defines a parameter as "test runtime"

Properties

$queue

$queue : array

The test queue

Type

array

$results

$results : array

The test results

Type

array

Methods

__construct()

__construct() 

Instantiates the tester

runTests()

runTests() : array

Runs the tests

Returns

array —

Test results

addOutputTest()

addOutputTest(string  $name, mixed  $outcome, array  $args = array()) : \Alo\Test\AbstractTester

Adds a test for the output

Parameters

string $name

The method/function name

mixed $outcome

The expected outcome

array $args

The arguments to pass on to the function/method

Returns

\Alo\Test\AbstractTester

addReturnTest()

addReturnTest(string  $name, mixed  $outcome, array  $args = array()) : \Alo\Test\AbstractTester

Adds a test for the return value

Parameters

string $name

The method/function name

mixed $outcome

The expected outcome

array $args

The arguments to pass on to the function/method

Returns

\Alo\Test\AbstractTester

getQueue()

getQueue() : array

Returns the common queue

Returns

array

getResults()

getResults() : array

Returns the testing results

Returns

array

toPlaintextString()

toPlaintextString() : string

Returns the test results as plaintext

Returns

string

__toString()

__toString() : string

Returns the test results in an HTML table

Returns

string —

HTML code

runTest()

runTest(array  $test) : \Alo\Test\AbstractTester

Runs an individual test

Parameters

array $test

The test specs

Returns

\Alo\Test\AbstractTester

getCallable()

getCallable(string  $name) : string

Returns the callable parameter for call_user_func_array()

Parameters

string $name

Method name

Returns

string

addGenericTest()

addGenericTest(string  $type, string  $name, mixed  $outcome, array  $args = array()) : \Alo\Test\AbstractTester

Adds a test for the output

Parameters

string $type

The type of the test - see this class' T_* constants

string $name

The method/function name

mixed $outcome

The expected outcome

array $args

The arguments to pass on to the function/method

Throws

\Alo\Exception\TesterException

When the method/function name is invalid

Returns

\Alo\Test\AbstractTester