Formatting output Plese Wait...
assert Class Reference
[Unit Testing]
This is the main Unit Testing Class that you will be using for unit testing operation.
More...
|
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.
You can also assiciate a Filename as well as a line number with it.
Show Source 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( boolean $expVal, string $errMsg = null
, string $file = null
, int $line = null
)
Result of the Test will be stored in a hard file.
- Parameters:
-
| $expVal | |
| $errMsg | Optional |
| $file | Optional |
| $line | Optional |
Definition at line 117 of file unit.php.
References assertItem(), and processTest().
Referenced by u().
Top
assert::strict( boolean $expVal, string $errMsg = null
, string $file = null
, int $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 | |
| $errMsg | Optional |
| $file | Optional |
| $line | Optional |
Definition at line 128 of file unit.php.
References assertItem(), and processTest().
Top
Process Test(s) Called by the other methods of the Class.
- Parameters:
-
| $assertItem | class="el" href="classassertItem.php" title="Item Class that holds the Result of Each Test.">assertItem |
| $isLive | boolean |
| $isStrict | |
Definition at line 139 of file unit.php.
References $GLOBALS, and perror().
Referenced by strict(), and valid().
Show Source00139 {
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 }
Top
The documentation for this class was generated from the following file: