Changeset 2283
- Timestamp:
- 03/11/2008 03:45:27 AM (9 months ago)
- Location:
- trunk/modules/unit_test
- Files:
-
- 3 modified
-
config/unit_test.php (modified) (1 diff)
-
libraries/Unit_Test.php (modified) (1 diff)
-
views/kohana_unit_test.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/unit_test/config/unit_test.php
r2279 r2283 6 6 */ 7 7 $config['paths'] = array(); 8 9 /** 10 * Set to TRUE if you want to hide passed tests from the report. 11 */ 12 $config['hide_passed'] = FALSE; -
trunk/modules/unit_test/libraries/Unit_Test.php
r2279 r2283 139 139 * Generates nice test results. 140 140 * 141 * @return string rendered test results html 142 */ 143 public function report() 144 { 141 * @param boolean hide passed tests from the report 142 * @return string rendered test results html 143 */ 144 public function report($hide_passed = NULL) 145 { 146 // No tests found 145 147 if (empty($this->results)) 146 return ''; 147 148 return Kohana::lang('unit_test.no_tests_found'); 149 150 // Hide passed tests from the report? 151 $hide_passed = (bool) (($hide_passed !== NULL) ? $hide_passed : Config::item('unit_test.hide_passed', FALSE, FALSE)); 152 153 // Render unit_test report 148 154 return View::factory('kohana_unit_test') 149 155 ->set('results', $this->results) 150 156 ->set('stats', $this->stats) 157 ->set('hide_passed', $hide_passed) 151 158 ->render(); 152 159 } -
trunk/modules/unit_test/views/kohana_unit_test.php
r2278 r2283 109 109 foreach ($methods as $method => $result): 110 110 111 ?> 111 // Hide passed tests from report 112 if ($result === TRUE AND $hide_passed === TRUE) 113 continue; 114 115 ?> 112 116 113 117 <tr class="<?php echo text::alternate('', 'k-altrow') ?>"> … … 118 122 <td class="k-passed"><strong><?php echo Kohana::lang('unit_test.passed') ?></strong></td> 119 123 120 <?php else : /* $result == Kohana_Unit_Test_Exception */?>124 <?php elseif ($result instanceof Kohana_Unit_Test_Exception): ?> 121 125 122 126 <td class="k-failed">
