00001 <?php
00008 class utFOUnitTestBase extends foUnitTestBase
00009 {
00010 public function doTest()
00011 {
00012 $this->_testNeedEmpty();
00013 $this->_testNeedNotEmpty();
00014 $this->_testNeedTrue();
00015 $this->_testNeedFalse();
00016 $this->_testNeedEqual();
00017 $this->_testNeedDiff();
00018 }
00019
00020 private function _testNeedEmpty()
00021 {
00022 $this->setSectionLabel('needEmpty');
00023 $this->addSectionText('Will check FOUnitTestBase::needEmpty().');
00024
00025
00026 eval($this->needEmpty('""'));
00027
00028 $nullVar = NULL;
00029 eval($this->needEmpty('$nullVar'));
00030
00031 $emptyArray = array();
00032 eval($this->needEmpty('$emptyArray'));
00033 }
00034
00035 private function _testNeedNotEmpty()
00036 {
00037 $this->setSectionLabel('needNotEmpty');
00038
00039
00040 eval($this->needNotEmpty('"Fareoffice"'));
00041 eval($this->needNotEmpty('0'));
00042
00043 $nonEmptyVar = 'Fareoffice';
00044 eval($this->needNotEmpty('$nonEmptyVar'));
00045
00046 $trueVar = true;
00047 eval($this->needNotEmpty('$trueVar'));
00048
00049 $nonEmptyArray = array(0,1,2);
00050 eval($this->needNotEmpty('$nonEmptyArray'));
00051 }
00052
00053 private function _testNeedTrue()
00054 {
00055 $this->setSectionLabel('needTrue');
00056
00057 eval($this->needTrue('(1==1)'));
00058 eval($this->needTrue('true'));
00059 eval($this->needTrue('!false'));
00060
00061 $trueVar = true;
00062 eval($this->needTrue('$trueVar'));
00063 }
00064
00065 private function _testNeedFalse()
00066 {
00067 $this->setSectionLabel('needFalse');
00068
00069 eval($this->needFalse('(1 != 1)'));
00070 eval($this->needFalse('false'));
00071 eval($this->needFalse('!true'));
00072
00073 $falseVar = false;
00074 eval($this->needFalse('$falseVar'));
00075 }
00076
00077 private function _testNeedEqual()
00078 {
00079 $this->setSectionLabel('needEqual');
00080
00081 eval($this->needEqual('(3+2)', '5'));
00082
00083 $numVar = 5;
00084 eval($this->needEqual('$numVar', '5'));
00085
00086 $stringVar = 'Fareoffice';
00087 eval($this->needEqual('$stringVar', '"Fareoffice"'));
00088
00089 $rootDir = dir("/tmp");
00090 eval($this->needEqual('$rootDir->path', '"/tmp"'));
00091
00092 $arr = array(1,2,3,4);
00093 eval($this->needEqual('$arr', 'unserialize("a:4:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;}")'));
00094 }
00095
00096 private function _testNeedDiff()
00097 {
00098 $this->setSectionLabel('needDiff');
00099
00100 eval($this->needDiff('(3+2)', '4'));
00101
00102 $numVar = 5;
00103 eval($this->needDiff('$numVar', '4'));
00104
00105 $stringVar = 'Fareoffice';
00106 eval($this->needDiff('$stringVar', '"fareoffice"'));
00107
00108 $rootDir = dir("/tmp");
00109 eval($this->needDiff('$rootDir->path', '"/tMp"'));
00110
00111 $arr = array(1,2,3,4);
00112 eval($this->needDiff('$arr', 'unserialize("a:4:{i:0;si:1;i:1;i:2;i:2;i:3;i:3;i:4;}")'));
00113 }
00114 }
00115 ?>