PHP Unit Testing Framework 1
A Unit testing framework for PHP.
Public Member Functions | Protected Attributes

TestCaseResultConstructor Class Reference

Constructs test case results. More...

Inheritance diagram for TestCaseResultConstructor:
TestCaseResult

Public Member Functions

 __construct ($name, $id)
 AddDetail (EventType $type, $reason, $message= '', $actual= '', $comparison= '')
 AddException ($place, Exception &$exception)
 AddTimeStamp (EventType $type)
 AddMessage ($message, $type)
 SetDetails ($name, $id, $description)

Protected Attributes

 $success
 True if the test passes, false otherwise.
 $testCaseId
 Test case ID.
 $name
 A name for the test case.
 $description
 And a description.
 $testEvents
 List of events for the result of this rest case.

Detailed Description

Constructs test case results.

A class to hide the construction of the test case results from the TestRunner::Report function. This is to enable external developer of a TestRunner to be decoupled from the internals of this framework.

Definition at line 609 of file php_unit_test.php.


Constructor & Destructor Documentation

__construct ( name,
id 
)

Constructs the TestCaseResultConstructor.

Parameters:
[in]string$nameThe name for the test case.
[in]string$idTest case ID.

Reimplemented from TestCaseResult.

Definition at line 622 of file php_unit_test.php.


Member Function Documentation

AddDetail ( EventType type,
reason,
message = '',
actual = '',
comparison = '' 
)

Adds a event to the test case result

Parameters:
[in]EventType$typeThe event type.
[in]string$reasonThe reason for this event (string).
[in]string$messageA user defined message (string). Enables commentary.
[in]mixed$actualThe actual value computed when running the test case.
[in]mixed$comparisonThe comparison value used in the test case.

Definition at line 635 of file php_unit_test.php.

AddException ( place,
Exception &$  exception 
)

Adds a exception to the test case result.

Parameters:
[in]string$placeThe phase in the test case where exception occurred.
[in]Exception$exceptionThe exception.

Definition at line 674 of file php_unit_test.php.

AddMessage ( message,
type 
)

Adds a message to the test case result.

Parameters:
[in]string$messageThe text for the message.
[in]EventType$typeThe type of the Message.

Definition at line 702 of file php_unit_test.php.

AddTimeStamp ( EventType type)

Adds a time stamp to the test case result to indicate a stage in the test case (e.g. start/end of set up).

Parameters:
[in]EventType$typeThe type of time stamp to be added.

Definition at line 692 of file php_unit_test.php.

SetDetails ( name,
id,
description 
)

Sets the test case name, ID and description.

Parameters:
[in]string$nameThe name for the test case.
[in]string$idThe ID for the test case.
[in]string$descriptionThe description for the test case.

Definition at line 720 of file php_unit_test.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables

© 2011, Ed Heal