Changeset 2289
- Timestamp:
- 03/12/08 10:32:25 (6 months ago)
- Location:
- trunk/modules/unit_test
- Files:
-
- 2 modified
-
libraries/Unit_Test.php (modified) (3 diffs)
-
views/kohana_unit_test.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/unit_test/libraries/Unit_Test.php
r2288 r2289 390 390 class Kohana_Unit_Test_Exception extends Exception { 391 391 392 protected $message = '';393 392 protected $debug = NULL; 394 protected $file = ''; 395 protected $line = ''; 396 397 /** 398 * Set exception message and debug 393 394 /** 395 * Sets exception message and debug info. 399 396 * 400 397 * @param string message … … 405 402 { 406 403 // Failure message 407 $this->message = (string) $message;404 parent::__construct($message); 408 405 409 406 // Extra user-defined debug info 410 407 $this->debug = $debug; 411 408 412 // Retrieve failure location409 // Overwrite failure location 413 410 $trace = $this->getTrace(); 414 411 $this->file = $trace[0]['file']; … … 417 414 418 415 /** 419 * Magically gets an object property. 420 * 421 * @param string property key 422 * @return mixed variable value if the key is found 423 * @return void if the key is not found 424 */ 425 public function __get($key) 426 { 427 if (isset($this->$key)) 428 return $this->$key; 416 * Returns the user-defined debug info 417 * 418 * @return mixed debug property 419 */ 420 public function getDebug() 421 { 422 return $this->debug; 429 423 } 430 424 -
trunk/modules/unit_test/views/kohana_unit_test.php
r2288 r2289 136 136 <td class="k-failed"> 137 137 <strong><?php echo Kohana::lang('unit_test.failed') ?></strong> 138 <pre><?php echo html::specialchars($result-> message) ?></pre>139 <?php echo html::specialchars($result-> file) ?> (<?php echo Kohana::lang('unit_test.line') ?> <?php echo $result->line?>)138 <pre><?php echo html::specialchars($result->getMessage()) ?></pre> 139 <?php echo html::specialchars($result->getFile()) ?> (<?php echo Kohana::lang('unit_test.line') ?> <?php echo $result->getLine() ?>) 140 140 141 <?php if ($result-> debug!== NULL): ?>142 <pre class="k-debug" title="Debug info"><?php echo '(', gettype($result-> debug), ') ', html::specialchars(var_export($result->debug, TRUE)) ?></pre>141 <?php if ($result->getDebug() !== NULL): ?> 142 <pre class="k-debug" title="Debug info"><?php echo '(', gettype($result->getDebug()), ') ', html::specialchars(var_export($result->getDebug(), TRUE)) ?></pre> 143 143 <?php endif ?> 144 144
