00001 <?php 00012 class unitTestReader extends zCore{ 00013 var $testFile; 00014 var $__struct; 00015 var $current=0; 00016 00023 function unitTestReader($sessId){ 00024 $testFile = ZIGROOT.DRS.Z_DIR_PROJECTS.DRS.Z_PROJECT_DIR.DRS.Z_DIR_UNIT_TEST.DRS.$sessId.'.zut'; 00025 if(!(is_file($testFile) && is_readable($testFile))){ 00026 perror("unitTest.read<br />Unable to Open $testFile for reading purpouse<br />Either the file doesn't exist or is not readable"); 00027 exit; 00028 }else{ 00029 $this->__struct = parse_ini_file($testFile, true); 00030 } 00031 if(count($this->__struct) <= 0){ 00032 perror("unitTest.read<br />No Unit Test(s) has been performed 0 Tests Found"); 00033 exit; 00034 } 00035 } 00041 function hasNext(){ 00042 return ($this->current < count($this->__struct)); 00043 } 00048 function next(){ 00049 ++$this->current; 00050 } 00056 function current(){ 00057 return $this->__struct[$this->current]; 00058 } 00064 function length(){ 00065 return count($this->__struct); 00066 } 00072 function currentIndex(){ 00073 return $this->current; 00074 } 00080 function totalPassed(){ 00081 $pi=0; 00082 foreach($this->__struct as $i => $testObj){ 00083 if($testObj['ExpFlag'] == 1){ 00084 ++$pi; 00085 } 00086 } 00087 return $pi; 00088 } 00089 } 00091 ?>