Changeset 65 for php/trunk/unittest/rdftestcases/rdftestcases.php
- Timestamp:
- Aug 7, 2011, 5:22:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
php/trunk/unittest/rdftestcases/rdftestcases.php
r64 r65 25 25 26 26 private $rdfDataManifest; 27 private $exceptions; 27 28 28 29 // -------------------------------------------------------- … … 31 32 32 33 $remoteManifest = 'http://www.w3.org/2000/10/rdf-tests/rdfcore/Manifest.rdf'; 33 $localManifest = 'Manifest.rdf';34 $localManifest = getenv('tmp').'/RDFTestcases_Manifest.rdf'; 34 35 35 36 $aNamespace = array( 'rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', … … 49 50 } 50 51 $result = $this->rdfDataManifest->parse( $localManifest); 52 53 // load exception list 54 $this->exceptions = explode( "\r\n", file_get_contents( 'exception.lst')); 51 55 52 56 } // public function __construct … … 77 81 78 82 // create name attribute from URI 83 // unshring URI values 79 84 foreach ($testcases as $testcase) { 80 85 $testcase->name = $this->_caseNameFromSubject( $testcase->getSubject()); 86 $testcase->input = $this->rdfDataManifest->_resolve( $testcase->input); 87 $testcase->output = $this->rdfDataManifest->_resolve( $testcase->output); 88 $testcase->conclusion = $this->rdfDataManifest->_resolve( $testcase->conclusion); 81 89 } 82 90 … … 98 106 $testcases = array(); 99 107 foreach ( $uriTestcases as $uriTestcase) { 108 109 // don't execute if in exception list 110 if (array_search( $this->_caseNameFromSubject( $uriTestcase), $this->exceptions) !== false) 111 continue; 112 113 100 114 if ($this->rdfDataManifest->_getFirstValue( $uriTestcase, 'test:status') == 'APPROVED') 101 115 $testcases[] = $uriTestcase; … … 104 118 return $testcases; 105 119 106 } // private function _ searchApprovedTestcases120 } // private function _getApprovedTestcaseSubjects 107 121 108 122 109 123 private function _countApprovedTestcases( $category) { 110 124 111 $uriTestcases = $this->rdfDataManifest->getSubjects( 'rdf:type', "test:$category"); 112 $count = 0; 113 foreach ( $uriTestcases as $uriTestcase) { 114 if ($this->rdfDataManifest->_getFirstValue( $uriTestcase, 'test:status') == 'APPROVED') 115 $count += 1; 116 } 117 118 return $count; 125 return count( $this->_getApprovedTestcaseSubjects( $category)); 119 126 120 127 } // private function _countApprovedTestcases … … 166 173 } 167 174 echo "$count cases for: $category\n\n"; 168 169 175 } else { 170 176 $count = $this->_countApprovedTestcases( $category); 171 177 echo " $category $count cases\n"; 172 178 } 173 174 175 179 } 176 180
Note:
See TracChangeset
for help on using the changeset viewer.