Changeset 21297
- Timestamp:
- 08/21/09 00:51:47 (4 years ago)
- Files:
-
- tools/lime/branches/2.0-experimental/lib/lime.php (modified) (2 diffs)
- tools/lime/branches/2.0-experimental/lib/output/LimeOutputConsoleSummary.php (modified) (1 diff)
- tools/lime/branches/2.0-experimental/lib/output/LimeOutputInspectable.php (modified) (5 diffs)
- tools/lime/branches/2.0-experimental/test/unit/output/LimeOutputInspectableTest.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/lime/branches/2.0-experimental/lib/lime.php
r20491 r21297 22 22 if (!is_array($options)) 23 23 { 24 $options = array('output' => $options); 24 // $options = array('output' => $options); 25 $options = array(); 25 26 } 26 27 … … 133 134 public function get_failed_files() 134 135 { 135 return $this-> getFailedFiles();136 return $this->output->getFailedFiles(); 136 137 } 137 138 } tools/lime/branches/2.0-experimental/lib/output/LimeOutputConsoleSummary.php
r21244 r21297 216 216 } 217 217 218 public function skip($message, $file, $line) {} 219 220 public function todo($message, $file, $line) {} 218 public function skip($message, $file, $line) 219 { 220 $this->actual[$this->file]++; 221 } 222 223 public function todo($message, $file, $line) 224 { 225 $this->actual[$this->file]++; 226 } 221 227 222 228 public function warning($message, $file, $line) tools/lime/branches/2.0-experimental/lib/output/LimeOutputInspectable.php
r21230 r21297 13 13 { 14 14 private 15 $output = null, 16 $passed = 0, 17 $failed = 0, 18 $skipped = 0, 19 $todos = 0, 20 $errors = 0, 21 $warnings = 0; 15 $output = null, 16 $passed = 0, 17 $failed = 0, 18 $skipped = 0, 19 $todos = 0, 20 $errors = 0, 21 $warnings = 0, 22 $failedFiles = array(); 22 23 23 24 public function __construct(LimeOutputInterface $output = null) … … 61 62 } 62 63 64 public function getFailedFiles() 65 { 66 return $this->failedFiles; 67 } 68 63 69 public function focus($file) 64 70 { … … 85 91 { 86 92 $this->failed++; 93 $this->failedFiles[] = $file; 87 94 $this->output->fail($message, $file, $line, $error); 88 95 } … … 103 110 { 104 111 $this->warnings++; 112 $this->failedFiles[] = $file; 105 113 $this->output->warning($message, $file, $line); 106 114 } … … 109 117 { 110 118 $this->errors++; 119 $this->failedFiles[] = $exception->getFile(); 111 120 $this->output->error($exception); 112 121 } tools/lime/branches/2.0-experimental/test/unit/output/LimeOutputInspectableTest.php
r21230 r21297 14 14 LimeAnnotationSupport::enable(); 15 15 16 $t = new LimeTest(1 5);16 $t = new LimeTest(16); 17 17 18 18 … … 102 102 // assertions 103 103 $mock->verify(); 104 105 106 // @Test: getFailedFiles() returns the scripts that contained failures, warnings or errors 107 108 // test 109 $output->pass('A passed test', '/test/script', 11); 110 $output->fail('A failed test', '/test/fail', 11); 111 $output->warning('A warning', '/test/warning', 11); 112 $output->error(new LimeError('An error', '/test/error', 11)); 113 // assertions 114 $actual = $output->getFailedFiles(); 115 $expected = array('/test/fail', '/test/warning', '/test/error'); 116 $t->is($actual, $expected, 'The correct test files are returned');