Loading Please wait...

Unit Testing


Data Structures

class  unitTestReader
 The Class that Reads Unit Test Files used by zigmoyd itself you dont need to use this class manually in your Code. More...
class  assertItem
 Item Class that holds the Result of Each Test. More...
class  unitList
 Holds the Unit Test(s) List e.g. More...
class  assert
 This is the main Unit Testing Class that you will be using for unit testing operation. More...

Functions

 assertItem ($exp, $errMsg=null, $file=null, $line=null)
 creates a new anonymous assertItem Object (e.g.
 u ($expVal, $errMsg=null, $file=null, $line=null)
 alias (shortcut to) of assert::valid()
 dumpTest ()
 Dumps the test results in an INI File.

Detailed Description

Zigmoyd supports Unit testing.
See also:
Unit testing Page for an initial introduction

Function Documentation

assertItem ( exp,
errMsg = null,
file = null,
line = null 
) [private]

creates a new anonymous assertItem Object (e.g.

a shortcut)

Parameters:
$exp boolean
$errMsg string
$file string
$line int
Returns:
assertItem

For internal use only.

Definition at line 48 of file unit.php.

Referenced by assert::strict(), and assert::valid().

00048                                                                {
00049   return (new assertItem($exp, $errMsg, $file, $line));
00050 }

dumpTest (  )  [private]

Dumps the test results in an INI File.

never call it automatically automatically called at the end.

Parameters:
$filePath string
$unitList unitList

Definition at line 172 of file unit.php.

References $filePath, $GLOBALS, zDef::get(), and perror().

00172                    {
00173   $filePath = zDef::get('UNIT_TEST_FILE');
00174   if(!$utfp = fopen($filePath, 'w')){
00175     perror("<pre>unit.dump</pre>Failed to open $filePath to write to dump Unit Testing Result(s)");
00176     return false;
00177   }
00178   $len = $GLOBALS['__uTList']->length();
00179   for($i=0;$i<$len;$i++){
00180     fwrite($utfp, "[$i]\n");
00181     $test = $GLOBALS['__uTList']->at($i);
00182     fwrite($utfp, "\tExpFlag=".(int)$test->expFlag.endl);
00183     fwrite($utfp, "\tErrMsg=\"".$test->errMsg."\"".endl);
00184     fwrite($utfp, "\tFileName=\"".$test->fileName."\"".endl);
00185     fwrite($utfp, "\tLineNum=".$test->lineNum.endl);
00186     fwrite($utfp, "\tTimeStamp=".$test->timeStamp.endl);
00187     fwrite($utfp, "\tDateTime=\"".$test->dateTime."\"");
00188     fwrite($utfp, "\n");
00189     $GLOBALS['__uTList']->removeNode($i);
00190   }
00191   fclose($utfp);
00192   return true;
00193 }

Here is the call graph for this function:

u ( expVal,
errMsg = null,
file = null,
line = null 
)

alias (shortcut to) of assert::valid()

See also:
assert::valid()
Parameters:
$expVal boolean
$errMsg string Optional
$file string Optional
$line int Optional

Definition at line 160 of file unit.php.

References assert::valid().

00160                                                          {
00161   return assert::valid($expVal, $errMsg, $file, $line);
00162 }

Here is the call graph for this function:


Generated on Mon Oct 27 23:52:40 2008 for zigmoyd.kdevelop by doxygen 1.5.6