Ticket #319: phing_undefined_variable_error.patch

File phing_undefined_variable_error.patch, 4.2 KB (added by tarjei@…, 3 years ago)
  • SimpleTestPlainResultFormatter.php

     
    5454        { 
    5555                parent::paintCaseEnd($test_name); 
    5656                 
     57    $sb = ""; 
    5758                /* Only count suites where more than one test was run */ 
    5859                if ($this->getRunCount()) 
    5960                { 
  • SimpleTestDebugResultFormatter.php

     
    4545        { 
    4646                parent::paintCaseStart($test_name); 
    4747                $this->paint( "Testsuite: $test_name\n"); 
    48         $this->current_case = $test_name; 
     48    $this->current_case = $test_name; 
    4949        } 
    50     function paintMethodStart($test_name) 
     50 
     51  function paintMethodStart($test_name) 
    5152        { 
    52                 parent::paintMethodStart($test_name); 
    53         $this->current_test = $test_name; 
    54         //$msg = "{$this->current_case} :: $test_name\n"; 
    55         $msg = "    TestCase: $test_name"; 
    56         $this->paint($msg); 
    57     } 
     53    parent::paintMethodStart($test_name); 
     54    $this->current_test = $test_name; 
     55    //$msg = "{$this->current_case} :: $test_name\n"; 
     56    $msg = "    TestCase: $test_name"; 
     57    $this->paint($msg); 
     58  } 
    5859 
    59     function paint($msg) { 
    60         if ($this->out == null ) { 
    61             print $msg; 
    62         } else { 
    63             $this->out->write($msg); 
    64         } 
    65  
    66  
     60  function paint($msg) { 
     61    if ($this->out == null ) { 
     62      print $msg; 
     63    } else { 
     64      $this->out->write($msg); 
    6765    } 
     66  } 
    6867 
    69     function paintMethodEnd($test_name) { 
    70         parent::paintMethodEnd($test_name); 
    71         $this->paint("\n"); 
     68  function paintMethodEnd($test_name) { 
     69    parent::paintMethodEnd($test_name); 
     70    $this->paint("\n"); 
     71  } 
    7272 
    73     } 
    74          
    75         function paintCaseEnd($test_name) 
    76         { 
    77                 parent::paintCaseEnd($test_name); 
    78         $this->current_case = ""; 
    79                 /* Only count suites where more than one test was run */ 
    80                 if ($this->getRunCount() && false) 
    81                 { 
    82                         $sb.= "Tests run: " . $this->getRunCount(); 
    83                         $sb.= ", Failures: " . $this->getFailureCount(); 
    84                         $sb.= ", Errors: " . $this->getErrorCount(); 
    85                         $sb.= ", Time elapsed: " . $this->getElapsedTime(); 
    86                         $sb.= " sec\n"; 
    87             $this->paint($sb); 
    88                 } 
     73  function paintCaseEnd($test_name) 
     74  { 
     75    parent::paintCaseEnd($test_name); 
     76    $this->current_case = ""; 
     77    /* Only count suites where more than one test was run */ 
    8978 
     79    if ($this->getRunCount() && false) 
     80    { 
     81      $sb = ""; 
     82      $sb.= "Tests run: " . $this->getRunCount(); 
     83      $sb.= ", Failures: " . $this->getFailureCount(); 
     84      $sb.= ", Errors: " . $this->getErrorCount(); 
     85      $sb.= ", Time elapsed: " . $this->getElapsedTime(); 
     86      $sb.= " sec\n"; 
     87      $this->paint($sb); 
    9088    } 
    9189 
    92         function paintError($message) 
    93         { 
    94                 parent::paintError($message); 
    95                 $this->formatError("ERROR", $message); 
    96         $this->failingTests[] = $this->current_case . "->" . $this->current_test; 
    97         } 
     90  } 
    9891 
    99         function paintFail($message) 
    100         { 
    101                 parent::paintFail($message); 
    102                 $this->formatError("FAILED", $message); 
    103         $this->failingTests[] = $this->current_case . "->" . $this->current_test; 
    104         } 
    105         function paintException($message) 
    106         { 
    107                 parent::paintException($message); 
    108                  
    109         $this->failingTests[] = $this->current_case . "->" . $this->current_test; 
    110                 $this->formatError("Exception", $message); 
    111         } 
     92  function paintError($message) 
     93  { 
     94    parent::paintError($message); 
     95    $this->formatError("ERROR", $message); 
     96    $this->failingTests[] = $this->current_case . "->" . $this->current_test; 
     97  } 
    11298 
     99  function paintFail($message) 
     100  { 
     101    parent::paintFail($message); 
     102    $this->formatError("FAILED", $message); 
     103    $this->failingTests[] = $this->current_case . "->" . $this->current_test; 
     104  } 
     105  function paintException($message) 
     106  { 
     107    parent::paintException($message); 
     108    $this->failingTests[] = $this->current_case . "->" . $this->current_test; 
     109    $this->formatError("Exception", $message); 
     110  } 
    113111 
    114112 
    115         private function formatError($type, $message) 
    116         { 
    117113 
    118         $this->paint("ERROR: $type: $message"); 
    119         } 
     114  private function formatError($type, $message) 
     115  { 
     116    $this->paint("ERROR: $type: $message"); 
     117  } 
    120118 
    121119} 
    122120?>