Changeset 2288
- Timestamp:
- 03/12/2008 10:16:18 AM (7 months ago)
- Location:
- trunk/modules/unit_test
- Files:
-
- 4 modified
-
i18n/en_US/unit_test.php (modified) (1 diff)
-
libraries/Unit_Test.php (modified) (2 diffs)
-
tests/Example_Test.php (modified) (1 diff)
-
views/kohana_unit_test.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/unit_test/i18n/en_US/unit_test.php
r2278 r2288 8 8 'test_class_extends' => '%s must extend Unit_Test_Case.', 9 9 'no_tests_found' => 'No tests found', 10 'stats' => 'Passed: %s / %s',11 10 'passed' => 'Passed', 12 11 'failed' => 'Failed', 12 'error' => 'Error', 13 'errors' => 'Errors', 13 14 'line' => 'line', 14 15 'assert_true' => 'Expected (boolean) TRUE, but was (%s) %s.', -
trunk/modules/unit_test/libraries/Unit_Test.php
r2283 r2288 85 85 // Initialize test class results and stats 86 86 $this->results[$class] = array(); 87 $this->stats[$class] = array('passed' => 0, 'failed' => 0 );87 $this->stats[$class] = array('passed' => 0, 'failed' => 0, 'errors' => 0); 88 88 89 89 // Loop through all the class methods … … 122 122 $this->stats[$class]['failed']++; 123 123 } 124 catch (Exception $e) 125 { 126 // Test error 127 $this->results[$class][$method_name] = $e; 128 $this->stats[$class]['errors']++; 129 } 124 130 125 131 // Run teardown method -
trunk/modules/unit_test/tests/Example_Test.php
r2270 r2288 69 69 } 70 70 71 public function error_test() 72 { 73 throw new Exception; 74 } 75 71 76 } -
trunk/modules/unit_test/views/kohana_unit_test.php
r2283 r2288 80 80 background-color: #FFD0D0; 81 81 } 82 #kohana-unit-test .k-error 83 { 84 background-color: #FFFFE0; 85 } 86 #kohana-unit-test .k-altrow .k-error 87 { 88 background-color: #FFFFD1; 89 } 82 90 </style> 83 91 … … 95 103 <th><?php echo $class ?></th> 96 104 <th class="k-stats"> 97 <?php echo Kohana::lang('unit_test.stats', $stats[$class]['passed'], array_sum($stats[$class])) ?> 105 <?php echo Kohana::lang('unit_test.passed'), ': ', $stats[$class]['passed'] ?>, 106 <?php echo Kohana::lang('unit_test.failed'), ': ', $stats[$class]['failed'] ?>, 107 <?php echo Kohana::lang('unit_test.errors'), ': ', $stats[$class]['errors'] ?> 98 108 </th> 99 109 </tr> … … 135 145 </td> 136 146 147 <?php elseif ($result instanceof Exception): ?> 148 149 <td class="k-error"> 150 <strong><?php echo Kohana::lang('unit_test.error') ?></strong> 151 <pre><?php echo html::specialchars($result->getMessage()) ?></pre> 152 <?php echo html::specialchars($result->getFile()) ?> (<?php echo Kohana::lang('unit_test.line') ?> <?php echo $result->getLine() ?>) 153 </td> 154 137 155 <?php endif ?> 138 156
