Show
Ignore:
Timestamp:
03/11/2008 03:45:27 AM (10 months ago)
Author:
Geert
Message:

Added unit_test.hide_passed config option to allow a more compact test report by hiding the passed tests.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/unit_test/libraries/Unit_Test.php

    r2279 r2283  
    139139         * Generates nice test results. 
    140140         * 
    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 
    145147                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 
    148154                return View::factory('kohana_unit_test') 
    149155                        ->set('results', $this->results) 
    150156                        ->set('stats', $this->stats) 
     157                        ->set('hide_passed', $hide_passed) 
    151158                        ->render(); 
    152159        }