Loading Please wait...

assert Class Reference
[Unit Testing]

This is the main Unit Testing Class that you will be using for unit testing operation. More...

Inheritance diagram for assert:

Inheritance graph
[legend]
Collaboration diagram for assert:

Collaboration graph
[legend]

Public Member Functions

 valid ($expVal, $errMsg=null, $file=null, $line=null)
 Result of the Test will be stored in a hard file.
 strict ($expVal, $errMsg=null, $file=null, $line=null)
 Result of the Test will be stored in a hard file But If the test fails your app will terminate and xyz(Unit test ID) Failed Error Message will be Fired on the Page.

Private Member Functions

 processTest ($assertItem, $isStrict)
 Process Test(s) Called by the other methods of the Class.

Detailed Description

This is the main Unit Testing Class that you will be using for unit testing operation.

you will use like.

 assert::valid(($x==2), "X is not 2") 
You can also assiciate a Filename as well as a line number with it.
 assert::valid(($x==2), "X is not 2", __FILE__, __LINE__) 
in PHP __FILE__ and __LINE__ exapands to the current filename and line number.

Definition at line 108 of file unit.php.


Member Function Documentation

assert::valid ( expVal,
errMsg = null,
file = null,
line = null 
)

Result of the Test will be stored in a hard file.

Parameters:
$expVal boolean
$errMsg string Optional
$file string Optional
$line int Optional

Definition at line 117 of file unit.php.

References assertItem(), and processTest().

Referenced by u().

00117                                                                {
00118     return assert::processTest(assertItem($expVal, $errMsg, $file, $line), false);
00119   }

Here is the call graph for this function:

assert::strict ( expVal,
errMsg = null,
file = null,
line = null 
)

Result of the Test will be stored in a hard file But If the test fails your app will terminate and xyz(Unit test ID) Failed Error Message will be Fired on the Page.

Parameters:
$expVal boolean
$errMsg string Optional
$file string Optional
$line int Optional

Definition at line 128 of file unit.php.

References assertItem(), and processTest().

00128                                                                 {
00129     return assert::processTest(assertItem($expVal, $errMsg, $file, $line), true);
00130   }

Here is the call graph for this function:

assert::processTest ( assertItem,
isStrict 
) [private]

Process Test(s) Called by the other methods of the Class.

Parameters:
$assertItem assertItem
$isLive boolean
$isStrict boolean

Definition at line 139 of file unit.php.

References $GLOBALS, and perror().

Referenced by strict(), and valid().

00139                                               {
00140     if($isStrict){
00141       if($assertItem->expFlag == 0){
00142         perror("<code>zigmoyd.unitTest.strict</code><br />Strict Unit Testing Failed.Further Processing Terminated.Check Unit Test Result for more details");
00143         $GLOBALS['__uTList']->append($assertItem);
00144         exit;
00145       }
00146     }
00147     $GLOBALS['__uTList']->append($assertItem);
00148   }

Here is the call graph for this function:


The documentation for this class was generated from the following file:

Generated on Mon Oct 27 23:53:00 2008 for zigmoyd.kdevelop by doxygen 1.5.6