utDb Class Reference
[Unit Tests - Unit tests for all classes/functions in fareofficelib.]

Unit test for all functions in Db.php. More...

List of all members.

Public Member Functions

 doTest ()

Private Member Functions

 _testEscN ()
 _testEscS ()


Detailed Description

Unit test for all functions in Db.php.

Author:
Daniel Lindh <daniel@fareoffice.com>

Definition at line 8 of file utDb.php.


Member Function Documentation

utDb::_testEscN (  )  [private]

Definition at line 16 of file utDb.php.

Referenced by doTest().

00017   {
00018     $this->setSectionLabel('escN');
00019 
00020     $emptyString = "";
00021     eval($this->needEqual('escN($emptyString)', '"NULL"'));
00022 
00023     $number23 = 23;
00024     eval($this->needEqual('escN($number23)', 23));
00025 
00026     $zeroNumber = 0;
00027     eval($this->needEqual('escN($zeroNumber)', 0));
00028   }

utDb::_testEscS (  )  [private]

Definition at line 30 of file utDb.php.

Referenced by doTest().

00031   {
00032     $this->setSectionLabel('escS');
00033 
00034     $emptyString = "";
00035     eval($this->needEqual('escS($emptyString)', '"NULL"'));
00036 
00037     $notEmptyString = "Game over man";
00038     eval($this->needEqual('escS($notEmptyString)', "'\'Game over man\''"));
00039     eval($this->needEqual('escS($notEmptyString, "%", ESC_NONE)', "'\'Game over man\''"));
00040     eval($this->needEqual('escS($notEmptyString, "%", ESC_LAST)', "'\'Game over man%\''"));
00041     eval($this->needEqual('escS($notEmptyString, "%", ESC_FIRST)', "'\'%Game over man\''"));
00042     eval($this->needEqual('escS($notEmptyString, "%", ESC_BOTH)', "'\'%Game over man%\''"));
00043 
00044     $number23 = 23;
00045     eval($this->needEqual('escS($number23)', "'\'23\''"));
00046 
00047     $zeroNumber = 0;
00048     eval($this->needEqual('escS($zeroNumber)', "'\'0\''"));
00049 
00050     $zeroNumber = 0;
00051     eval($this->needEqual('escS($zeroNumber)', 0));
00052   }

utDb::doTest (  ) 

Definition at line 10 of file utDb.php.

References _testEscN(), and _testEscS().

00011   {
00012     $this->_testEscN();
00013     $this->_testEscS();
00014   }


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

Generated on Thu Apr 30 17:52:30 2009 for fareofficelib by  doxygen 1.5.8