Changeset 61a14c5
- Timestamp:
- 11/01/11 15:12:20 (7 months ago)
- Branches:
- master
- Children:
- a81c6c9
- Parents:
- d401315
- git-author:
- Michiel Rook <mrook@…> (11/01/11 15:12:20)
- git-committer:
- Michiel Rook <mrook@…> (11/01/11 15:12:20)
- Location:
- classes/phing/tasks/ext/phpunit
- Files:
-
- 2 edited
-
BatchTest.php (modified) (3 diffs)
-
PHPUnitTask.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
classes/phing/tasks/ext/phpunit/BatchTest.php
r07f823b r61a14c5 166 166 * @return array an array of tests. 167 167 */ 168 p ublicfunction elements()168 protected function elements() 169 169 { 170 170 $filenames = $this->getFilenames(); … … 191 191 * Returns a testsuite containing all the tests in this batch 192 192 * 193 * @deprecated 193 194 * @return PHPUnit_Framework_TestSuite 194 195 */ … … 206 207 return $suite; 207 208 } 209 210 /** 211 * Add the tests in this batchtest to a test suite 212 * @param PHPUnit_Framework_TestSuite $suite 213 */ 214 public function addToTestSuite(PHPUnit_Framework_TestSuite $suite) 215 { 216 foreach ($this->elements() as $element) { 217 $suite->addTestSuite(new ReflectionClass($element)); 218 } 219 } 220 208 221 } -
classes/phing/tasks/ext/phpunit/PHPUnitTask.php
r07f823b r61a14c5 242 242 } 243 243 244 foreach ($this->formatters as $fe)245 {246 $formatter = $fe->getFormatter();247 248 if ($fe->getUseFile())249 {250 $destFile = new PhingFile($fe->getToDir(), $fe->getOutfile());251 252 $writer = new FileWriter($destFile->getAbsolutePath());253 254 $formatter->setOutput($writer);255 }256 else257 {258 $formatter->setOutput($this->getDefaultOutput());259 }260 261 $formatter->startTestRun();262 }263 264 244 $suite = new PHPUnit_Framework_TestSuite('AllTests'); 265 245 266 246 foreach ($this->batchtests as $batchtest) 267 247 { 268 $elements = $batchtest->elements(); 269 270 foreach ($elements as $element) { 271 $suite->addTestSuite(new ReflectionClass($element)); 272 } 273 274 //$suite->addTestSuite($batchtest->getTestSuite()); 248 $batchtest->addToTestSuite($suite); 275 249 } 276 250 277 251 $this->execute($suite); 278 279 foreach ($this->formatters as $fe)280 {281 $formatter = $fe->getFormatter();282 $formatter->endTestRun();283 }284 252 285 253 if ($this->testfailed) … … 323 291 $formatter = $fe->getFormatter(); 324 292 293 if ($fe->getUseFile()) 294 { 295 $destFile = new PhingFile($fe->getToDir(), $fe->getOutfile()); 296 297 $writer = new FileWriter($destFile->getAbsolutePath()); 298 299 $formatter->setOutput($writer); 300 } 301 else 302 { 303 $formatter->setOutput($this->getDefaultOutput()); 304 } 305 325 306 $runner->addFormatter($formatter); 307 308 $formatter->startTestRun(); 326 309 } 327 310 328 311 $runner->run($suite); 329 312 313 foreach ($this->formatters as $fe) 314 { 315 $formatter = $fe->getFormatter(); 316 $formatter->endTestRun(); 317 } 318 330 319 $retcode = $runner->getRetCode(); 331 320
Note: See TracChangeset
for help on using the changeset viewer.
