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

Unit test for the class foUnitTestBase. More...

List of all members.

Public Member Functions

 doTest ()

Private Member Functions

 _testNeedEmpty ()
 _testNeedNotEmpty ()
 _testNeedTrue ()
 _testNeedFalse ()
 _testNeedEqual ()
 _testNeedDiff ()
 _testNeedDiffReq ()
 _testNeedDate ()


Detailed Description

Unit test for the class foUnitTestBase.

Author:
Daniel Lindh <[email protected]>

Definition at line 8 of file UTFOUnitTestBase.class.php.


Member Function Documentation

utFOUnitTestBase::_testNeedDate (  )  [private]

Definition at line 136 of file UTFOUnitTestBase.class.php.

Referenced by doTest().

00137   {
00138     $this->setSectionLabel('needDate');
00139 
00140     eval($this->needDate('"2001-01-01"'));
00141     eval($this->needDate('"2001-01-30"'));
00142     eval($this->needDate('"2001-01-20 20:00"'));
00143     eval($this->needDate('"2001-01-20 20:00:00"'));
00144     eval($this->needDate('"2001-01-20 20:00:00"'));
00145     eval($this->needDate('"01jan2009"'));
00146   }

utFOUnitTestBase::_testNeedDiff (  )  [private]

Definition at line 98 of file UTFOUnitTestBase.class.php.

Referenced by doTest().

00099   {
00100     $this->setSectionLabel('needDiff');
00101 
00102     eval($this->needDiff('(3+2)', '4'));
00103 
00104     $numVar = 5;
00105     eval($this->needDiff('$numVar', '4'));
00106 
00107     $stringVar = 'Fareoffice';
00108     eval($this->needDiff('$stringVar', '"fareoffice"'));
00109 
00110     $rootDir = dir("/tmp");
00111     eval($this->needDiff('$rootDir->path', '"/tMp"'));
00112 
00113     $arr = array(1,2,3,4);
00114     eval($this->needDiff('$arr', 'unserialize("a:4:{i:0;si:1;i:1;i:2;i:2;i:3;i:3;i:4;}")'));
00115   }

utFOUnitTestBase::_testNeedDiffReq (  )  [private]

Definition at line 117 of file UTFOUnitTestBase.class.php.

Referenced by doTest().

00118   {
00119     $this->setSectionLabel('needEqualReg');
00120 
00121     eval($this->needEqualReg('(3+102)', '"/^[\d]{2,3}$/"'));
00122 
00123     $numVar = 5;
00124     eval($this->needEqualReg('$numVar', '"/^[5]$/"'));
00125 
00126     $stringVar = 'Fareoffice';
00127     eval($this->needEqualReg('$stringVar', '"/^[\w]*$/"'));
00128 
00129     $rootDir = dir("/tmp");
00130     eval($this->needEqualReg('$rootDir->path', '"/^[\/][\w]*$/"'));
00131 
00132     $today = date('dMY H:i:s', strtotime('now'));
00133     eval($this->needEqualReg('$today', '"/^[\d]{2}[\w]{3}[\d]{4} [\d]{2}[:][\d]{2}[:][\d]{2}$/"'));
00134   }

utFOUnitTestBase::_testNeedEmpty (  )  [private]

Definition at line 22 of file UTFOUnitTestBase.class.php.

Referenced by doTest().

00023   {
00024     $this->setSectionLabel('needEmpty');
00025     $this->addSectionText('Will check FOUnitTestBase::needEmpty().');
00026 
00027     // Will succeed
00028     eval($this->needEmpty('""'));
00029 
00030     $nullVar = NULL;
00031     eval($this->needEmpty('$nullVar'));
00032 
00033     $emptyArray = array();
00034     eval($this->needEmpty('$emptyArray'));
00035   }

utFOUnitTestBase::_testNeedEqual (  )  [private]

Definition at line 79 of file UTFOUnitTestBase.class.php.

Referenced by doTest().

00080   {
00081     $this->setSectionLabel('needEqual');
00082 
00083     eval($this->needEqual('(3+2)', '5'));
00084 
00085     $numVar = 5;
00086     eval($this->needEqual('$numVar', '5'));
00087 
00088     $stringVar = 'Fareoffice';
00089     eval($this->needEqual('$stringVar', '"Fareoffice"'));
00090 
00091     $rootDir = dir("/tmp");
00092     eval($this->needEqual('$rootDir->path', '"/tmp"'));
00093 
00094     $arr = array(1,2,3,4);
00095     eval($this->needEqual('$arr', 'unserialize("a:4:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;}")'));
00096   }

utFOUnitTestBase::_testNeedFalse (  )  [private]

Definition at line 67 of file UTFOUnitTestBase.class.php.

Referenced by doTest().

00068   {
00069     $this->setSectionLabel('needFalse');
00070 
00071     eval($this->needFalse('(1 != 1)'));
00072     eval($this->needFalse('false'));
00073     eval($this->needFalse('!true'));
00074 
00075     $falseVar = false;
00076     eval($this->needFalse('$falseVar'));
00077   }

utFOUnitTestBase::_testNeedNotEmpty (  )  [private]

Definition at line 37 of file UTFOUnitTestBase.class.php.

Referenced by doTest().

00038   {
00039     $this->setSectionLabel('needNotEmpty');
00040 
00041     // Will succeed
00042     eval($this->needNotEmpty('"Fareoffice"'));
00043     eval($this->needNotEmpty('0'));
00044 
00045     $nonEmptyVar = 'Fareoffice';
00046     eval($this->needNotEmpty('$nonEmptyVar'));
00047 
00048     $trueVar = true;
00049     eval($this->needNotEmpty('$trueVar'));
00050 
00051     $nonEmptyArray = array(0,1,2);
00052     eval($this->needNotEmpty('$nonEmptyArray'));
00053   }

utFOUnitTestBase::_testNeedTrue (  )  [private]

Definition at line 55 of file UTFOUnitTestBase.class.php.

Referenced by doTest().

00056   {
00057     $this->setSectionLabel('needTrue');
00058 
00059     eval($this->needTrue('(1==1)'));
00060     eval($this->needTrue('true'));
00061     eval($this->needTrue('!false'));
00062 
00063     $trueVar = true;
00064     eval($this->needTrue('$trueVar'));
00065   }

utFOUnitTestBase::doTest (  ) 

Definition at line 10 of file UTFOUnitTestBase.class.php.

References _testNeedDate(), _testNeedDiff(), _testNeedDiffReq(), _testNeedEmpty(), _testNeedEqual(), _testNeedFalse(), _testNeedNotEmpty(), and _testNeedTrue().

00011   {
00012     $this->_testNeedEmpty();
00013     $this->_testNeedNotEmpty();
00014     $this->_testNeedTrue();
00015     $this->_testNeedFalse();
00016     $this->_testNeedEqual();
00017     $this->_testNeedDiff();
00018     $this->_testNeedDiffReq();
00019     $this->_testNeedDate();
00020   }


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

Generated on Wed May 6 23:28:24 2009 for fareofficelib by  doxygen 1.5.8