Source for file scorer.php

Documentation is available at scorer.php

  1. <?php
  2. /**
  3.  *  base include file for SimpleTest
  4.  *  @package    SimpleTest
  5.  *  @subpackage UnitTester
  6.  *  @version    $Id: scorer.php 1788 2008-04-27 11:01:59Z pp11 $
  7.  */
  8.  
  9. /**#@+*/
  10. require_once(dirname(__FILE__'/invoker.php');
  11. /**#@-*/
  12.  
  13. /**
  14.  *    Can receive test events and display them. Display
  15.  *    is achieved by making display methods available
  16.  *    and visiting the incoming event.
  17.  *    @package SimpleTest
  18.  *    @subpackage UnitTester
  19.  *    @abstract
  20.  */
  21. class SimpleScorer {
  22.     private $passes;
  23.     private $fails;
  24.     private $exceptions;
  25.     private $is_dry_run;
  26.  
  27.     /**
  28.      *    Starts the test run with no results.
  29.      *    @access public
  30.      */
  31.     function __construct({
  32.         $this->passes 0;
  33.         $this->fails 0;
  34.         $this->exceptions 0;
  35.         $this->is_dry_run false;
  36.     }
  37.  
  38.     /**
  39.      *    Signals that the next evaluation will be a dry
  40.      *    run. That is, the structure events will be
  41.      *    recorded, but no tests will be run.
  42.      *    @param boolean $is_dry        Dry run if true.
  43.      *    @access public
  44.      */
  45.     function makeDry($is_dry true{
  46.         $this->is_dry_run $is_dry;
  47.     }
  48.  
  49.     /**
  50.      *    The reporter has a veto on what should be run.
  51.      *    @param string $test_case_name  name of test case.
  52.      *    @param string $method          Name of test method.
  53.      *    @access public
  54.      */
  55.     function shouldInvoke($test_case_name$method{
  56.         return $this->is_dry_run;
  57.     }
  58.  
  59.     /**
  60.      *    Can wrap the invoker in preperation for running
  61.      *    a test.
  62.      *    @param SimpleInvoker $invoker   Individual test runner.
  63.      *    @return SimpleInvoker           Wrapped test runner.
  64.      *    @access public
  65.      */
  66.     function createInvoker($invoker{
  67.         return $invoker;
  68.     }
  69.  
  70.     /**
  71.      *    Accessor for current status. Will be false
  72.      *    if there have been any failures or exceptions.
  73.      *    Used for command line tools.
  74.      *    @return boolean        True if no failures.
  75.      *    @access public
  76.      */
  77.     function getStatus({
  78.         if ($this->exceptions $this->fails 0{
  79.             return false;
  80.         }
  81.         return true;
  82.     }
  83.  
  84.     /**
  85.      *    Paints the start of a group test.
  86.      *    @param string $test_name     Name of test or other label.
  87.      *    @param integer $size         Number of test cases starting.
  88.      *    @access public
  89.      */
  90.     function paintGroupStart($test_name$size{
  91.     }
  92.  
  93.     /**
  94.      *    Paints the end of a group test.
  95.      *    @param string $test_name     Name of test or other label.
  96.      *    @access public
  97.      */
  98.     function paintGroupEnd($test_name{
  99.     }
  100.  
  101.     /**
  102.      *    Paints the start of a test case.
  103.      *    @param string $test_name     Name of test or other label.
  104.      *    @access public
  105.      */
  106.     function paintCaseStart($test_name{
  107.     }
  108.  
  109.     /**
  110.      *    Paints the end of a test case.
  111.      *    @param string $test_name     Name of test or other label.
  112.      *    @access public
  113.      */
  114.     function paintCaseEnd($test_name{
  115.     }
  116.  
  117.     /**
  118.      *    Paints the start of a test method.
  119.      *    @param string $test_name     Name of test or other label.
  120.      *    @access public
  121.      */
  122.     function paintMethodStart($test_name{
  123.     }
  124.  
  125.     /**
  126.      *    Paints the end of a test method.
  127.      *    @param string $test_name     Name of test or other label.
  128.      *    @access public
  129.      */
  130.     function paintMethodEnd($test_name{
  131.     }
  132.  
  133.     /**
  134.      *    Increments the pass count.
  135.      *    @param string $message        Message is ignored.
  136.      *    @access public
  137.      */
  138.     function paintPass($message{
  139.         $this->passes++;
  140.     }
  141.  
  142.     /**
  143.      *    Increments the fail count.
  144.      *    @param string $message        Message is ignored.
  145.      *    @access public
  146.      */
  147.     function paintFail($message{
  148.         $this->fails++;
  149.     }
  150.  
  151.     /**
  152.      *    Deals with PHP 4 throwing an error.
  153.      *    @param string $message    Text of error formatted by
  154.      *                               the test case.
  155.      *    @access public
  156.      */
  157.     function paintError($message{
  158.         $this->exceptions++;
  159.     }
  160.  
  161.     /**
  162.      *    Deals with PHP 5 throwing an exception.
  163.      *    @param Exception $exception    The actual exception thrown.
  164.      *    @access public
  165.      */
  166.     function paintException($exception{
  167.         $this->exceptions++;
  168.     }
  169.     
  170.     /**
  171.      *    Prints the message for skipping tests.
  172.      *    @param string $message    Text of skip condition.
  173.      *    @access public
  174.      */
  175.     function paintSkip($message{
  176.     }
  177.  
  178.     /**
  179.      *    Accessor for the number of passes so far.
  180.      *    @return integer       Number of passes.
  181.      *    @access public
  182.      */
  183.     function getPassCount({
  184.         return $this->passes;
  185.     }
  186.  
  187.     /**
  188.      *    Accessor for the number of fails so far.
  189.      *    @return integer       Number of fails.
  190.      *    @access public
  191.      */
  192.     function getFailCount({
  193.         return $this->fails;
  194.     }
  195.  
  196.     /**
  197.      *    Accessor for the number of untrapped errors
  198.      *    so far.
  199.      *    @return integer       Number of exceptions.
  200.      *    @access public
  201.      */
  202.     function getExceptionCount({
  203.         return $this->exceptions;
  204.     }
  205.  
  206.     /**
  207.      *    Paints a simple supplementary message.
  208.      *    @param string $message        Text to display.
  209.      *    @access public
  210.      */
  211.     function paintMessage($message{
  212.     }
  213.  
  214.     /**
  215.      *    Paints a formatted ASCII message such as a
  216.      *    privateiable dump.
  217.      *    @param string $message        Text to display.
  218.      *    @access public
  219.      */
  220.     function paintFormattedMessage($message{
  221.     }
  222.  
  223.     /**
  224.      *    By default just ignores user generated events.
  225.      *    @param string $type        Event type as text.
  226.      *    @param mixed $payload      Message or object.
  227.      *    @access public
  228.      */
  229.     function paintSignal($type$payload{
  230.     }
  231. }
  232.  
  233. /**
  234.  *    Recipient of generated test messages that can display
  235.  *    page footers and headers. Also keeps track of the
  236.  *    test nesting. This is the main base class on which
  237.  *    to build the finished test (page based) displays.
  238.  *    @package SimpleTest
  239.  *    @subpackage UnitTester
  240.  */
  241. class SimpleReporter extends SimpleScorer {
  242.     private $test_stack;
  243.     private $size;
  244.     private $progress;
  245.  
  246.     /**
  247.      *    Starts the display with no results in.
  248.      *    @access public
  249.      */
  250.     function __construct({
  251.         parent::__construct();
  252.         $this->test_stack array();
  253.         $this->size null;
  254.         $this->progress 0;
  255.     }
  256.     
  257.     /**
  258.      *    Gets the formatter for privateiables and other small
  259.      *    generic data items.
  260.      *    @return SimpleDumper          Formatter.
  261.      *    @access public
  262.      */
  263.     function getDumper({
  264.         return new SimpleDumper();
  265.     }
  266.  
  267.     /**
  268.      *    Paints the start of a group test. Will also paint
  269.      *    the page header and footer if this is the
  270.      *    first test. Will stash the size if the first
  271.      *    start.
  272.      *    @param string $test_name   Name of test that is starting.
  273.      *    @param integer $size       Number of test cases starting.
  274.      *    @access public
  275.      */
  276.     function paintGroupStart($test_name$size{
  277.         if (isset($this->size)) {
  278.             $this->size $size;
  279.         }
  280.         if (count($this->test_stack== 0{
  281.             $this->paintHeader($test_name);
  282.         }
  283.         $this->test_stack[$test_name;
  284.     }
  285.  
  286.     /**
  287.      *    Paints the end of a group test. Will paint the page
  288.      *    footer if the stack of tests has unwound.
  289.      *    @param string $test_name   Name of test that is ending.
  290.      *    @param integer $progress   Number of test cases ending.
  291.      *    @access public
  292.      */
  293.     function paintGroupEnd($test_name{
  294.         array_pop($this->test_stack);
  295.         if (count($this->test_stack== 0{
  296.             $this->paintFooter($test_name);
  297.         }
  298.     }
  299.  
  300.     /**
  301.      *    Paints the start of a test case. Will also paint
  302.      *    the page header and footer if this is the
  303.      *    first test. Will stash the size if the first
  304.      *    start.
  305.      *    @param string $test_name   Name of test that is starting.
  306.      *    @access public
  307.      */
  308.     function paintCaseStart($test_name{
  309.         if (isset($this->size)) {
  310.             $this->size 1;
  311.         }
  312.         if (count($this->test_stack== 0{
  313.             $this->paintHeader($test_name);
  314.         }
  315.         $this->test_stack[$test_name;
  316.     }
  317.  
  318.     /**
  319.      *    Paints the end of a test case. Will paint the page
  320.      *    footer if the stack of tests has unwound.
  321.      *    @param string $test_name   Name of test that is ending.
  322.      *    @access public
  323.      */
  324.     function paintCaseEnd($test_name{
  325.         $this->progress++;
  326.         array_pop($this->test_stack);
  327.         if (count($this->test_stack== 0{
  328.             $this->paintFooter($test_name);
  329.         }
  330.     }
  331.  
  332.     /**
  333.      *    Paints the start of a test method.
  334.      *    @param string $test_name   Name of test that is starting.
  335.      *    @access public
  336.      */
  337.     function paintMethodStart($test_name{
  338.         $this->test_stack[$test_name;
  339.     }
  340.  
  341.     /**
  342.      *    Paints the end of a test method. Will paint the page
  343.      *    footer if the stack of tests has unwound.
  344.      *    @param string $test_name   Name of test that is ending.
  345.      *    @access public
  346.      */
  347.     function paintMethodEnd($test_name{
  348.         array_pop($this->test_stack);
  349.     }
  350.  
  351.     /**
  352.      *    Paints the test document header.
  353.      *    @param string $test_name     First test top level
  354.      *                                  to start.
  355.      *    @access public
  356.      *    @abstract
  357.      */
  358.     function paintHeader($test_name{
  359.     }
  360.  
  361.     /**
  362.      *    Paints the test document footer.
  363.      *    @param string $test_name        The top level test.
  364.      *    @access public
  365.      *    @abstract
  366.      */
  367.     function paintFooter($test_name{
  368.     }
  369.  
  370.     /**
  371.      *    Accessor for internal test stack. For
  372.      *    subclasses that need to see the whole test
  373.      *    history for display purposes.
  374.      *    @return array     List of methods in nesting order.
  375.      *    @access public
  376.      */
  377.     function getTestList({
  378.         return $this->test_stack;
  379.     }
  380.  
  381.     /**
  382.      *    Accessor for total test size in number
  383.      *    of test cases. Null until the first
  384.      *    test is started.
  385.      *    @return integer   Total number of cases at start.
  386.      *    @access public
  387.      */
  388.     function getTestCaseCount({
  389.         return $this->size;
  390.     }
  391.  
  392.     /**
  393.      *    Accessor for the number of test cases
  394.      *    completed so far.
  395.      *    @return integer   Number of ended cases.
  396.      *    @access public
  397.      */
  398.     function getTestCaseProgress({
  399.         return $this->progress;
  400.     }
  401.  
  402.     /**
  403.      *    Static check for running in the comand line.
  404.      *    @return boolean        True if CLI.
  405.      *    @access public
  406.      */
  407.     static function inCli({
  408.         return php_sapi_name(== 'cli';
  409.     }
  410. }
  411.  
  412. /**
  413.  *    For modifying the behaviour of the visual reporters.
  414.  *    @package SimpleTest
  415.  *    @subpackage UnitTester
  416.  */
  417.     protected $reporter;
  418.  
  419.     /**
  420.      *    Mediates between the reporter and the test case.
  421.      *    @param SimpleScorer $reporter       Reporter to receive events.
  422.      */
  423.     function __construct($reporter{
  424.         $this->reporter = $reporter;
  425.     }
  426.  
  427.     /**
  428.      *    Signals that the next evaluation will be a dry
  429.      *    run. That is, the structure events will be
  430.      *    recorded, but no tests will be run.
  431.      *    @param boolean $is_dry        Dry run if true.
  432.      *    @access public
  433.      */
  434.     function makeDry($is_dry true{
  435.         $this->reporter->makeDry($is_dry);
  436.     }
  437.  
  438.     /**
  439.      *    Accessor for current status. Will be false
  440.      *    if there have been any failures or exceptions.
  441.      *    Used for command line tools.
  442.      *    @return boolean        True if no failures.
  443.      *    @access public
  444.      */
  445.     function getStatus({
  446.         return $this->reporter->getStatus();
  447.     }
  448.  
  449.     /**
  450.      *    The reporter has a veto on what should be run.
  451.      *    @param string $test_case_name  name of test case.
  452.      *    @param string $method          Name of test method.
  453.      *    @return boolean                True if test should be run.
  454.      *    @access public
  455.      */
  456.     function shouldInvoke($test_case_name$method{
  457.         return $this->reporter->shouldInvoke($test_case_name$method);
  458.     }
  459.  
  460.     /**
  461.      *    Can wrap the invoker in preperation for running
  462.      *    a test.
  463.      *    @param SimpleInvoker $invoker   Individual test runner.
  464.      *    @return SimpleInvoker           Wrapped test runner.
  465.      *    @access public
  466.      */
  467.     function createInvoker($invoker{
  468.         return $this->reporter->createInvoker($invoker);
  469.     }
  470.     
  471.     /**
  472.      *    Gets the formatter for privateiables and other small
  473.      *    generic data items.
  474.      *    @return SimpleDumper          Formatter.
  475.      *    @access public
  476.      */
  477.     function getDumper({
  478.         return $this->reporter->getDumper();
  479.     }
  480.  
  481.     /**
  482.      *    Paints the start of a group test.
  483.      *    @param string $test_name     Name of test or other label.
  484.      *    @param integer $size         Number of test cases starting.
  485.      *    @access public
  486.      */
  487.     function paintGroupStart($test_name$size{
  488.         $this->reporter->paintGroupStart($test_name$size);
  489.     }
  490.  
  491.     /**
  492.      *    Paints the end of a group test.
  493.      *    @param string $test_name     Name of test or other label.
  494.      *    @access public
  495.      */
  496.     function paintGroupEnd($test_name{
  497.         $this->reporter->paintGroupEnd($test_name);
  498.     }
  499.  
  500.     /**
  501.      *    Paints the start of a test case.
  502.      *    @param string $test_name     Name of test or other label.
  503.      *    @access public
  504.      */
  505.     function paintCaseStart($test_name{
  506.         $this->reporter->paintCaseStart($test_name);
  507.     }
  508.  
  509.     /**
  510.      *    Paints the end of a test case.
  511.      *    @param string $test_name     Name of test or other label.
  512.      *    @access public
  513.      */
  514.     function paintCaseEnd($test_name{
  515.         $this->reporter->paintCaseEnd($test_name);
  516.     }
  517.  
  518.     /**
  519.      *    Paints the start of a test method.
  520.      *    @param string $test_name     Name of test or other label.
  521.      *    @access public
  522.      */
  523.     function paintMethodStart($test_name{
  524.         $this->reporter->paintMethodStart($test_name);
  525.     }
  526.  
  527.     /**
  528.      *    Paints the end of a test method.
  529.      *    @param string $test_name     Name of test or other label.
  530.      *    @access public
  531.      */
  532.     function paintMethodEnd($test_name{
  533.         $this->reporter->paintMethodEnd($test_name);
  534.     }
  535.  
  536.     /**
  537.      *    Chains to the wrapped reporter.
  538.      *    @param string $message        Message is ignored.
  539.      *    @access public
  540.      */
  541.     function paintPass($message{
  542.         $this->reporter->paintPass($message);
  543.     }
  544.  
  545.     /**
  546.      *    Chains to the wrapped reporter.
  547.      *    @param string $message        Message is ignored.
  548.      *    @access public
  549.      */
  550.     function paintFail($message{
  551.         $this->reporter->paintFail($message);
  552.     }
  553.  
  554.     /**
  555.      *    Chains to the wrapped reporter.
  556.      *    @param string $message    Text of error formatted by
  557.      *                               the test case.
  558.      *    @access public
  559.      */
  560.     function paintError($message{
  561.         $this->reporter->paintError($message);
  562.     }
  563.  
  564.     /**
  565.      *    Chains to the wrapped reporter.
  566.      *    @param Exception $exception        Exception to show.
  567.      *    @access public
  568.      */
  569.     function paintException($exception{
  570.         $this->reporter->paintException($exception);
  571.     }
  572.     
  573.     /**
  574.      *    Prints the message for skipping tests.
  575.      *    @param string $message    Text of skip condition.
  576.      *    @access public
  577.      */
  578.     function paintSkip($message{
  579.         $this->reporter->paintSkip($message);
  580.     }
  581.  
  582.     /**
  583.      *    Chains to the wrapped reporter.
  584.      *    @param string $message        Text to display.
  585.      *    @access public
  586.      */
  587.     function paintMessage($message{
  588.         $this->reporter->paintMessage($message);
  589.     }
  590.  
  591.     /**
  592.      *    Chains to the wrapped reporter.
  593.      *    @param string $message        Text to display.
  594.      *    @access public
  595.      */
  596.     function paintFormattedMessage($message{
  597.         $this->reporter->paintFormattedMessage($message);
  598.     }
  599.  
  600.     /**
  601.      *    Chains to the wrapped reporter.
  602.      *    @param string $type        Event type as text.
  603.      *    @param mixed $payload      Message or object.
  604.      *    @return boolean            Should return false if this
  605.      *                                type of signal should fail the
  606.      *                                test suite.
  607.      *    @access public
  608.      */
  609.     function paintSignal($type$payload{
  610.         $this->reporter->paintSignal($type$payload);
  611.     }
  612. }
  613.  
  614. /**
  615.  *    For sending messages to multiple reporters at
  616.  *    the same time.
  617.  *    @package SimpleTest
  618.  *    @subpackage UnitTester
  619.  */
  620.     private $reporters array();
  621.  
  622.     /**
  623.      *    Adds a reporter to the subscriber list.
  624.      *    @param SimpleScorer $reporter     Reporter to receive events.
  625.      *    @access public
  626.      */
  627.     function attachReporter($reporter{
  628.         $this->reporters[$reporter;
  629.     }
  630.  
  631.     /**
  632.      *    Signals that the next evaluation will be a dry
  633.      *    run. That is, the structure events will be
  634.      *    recorded, but no tests will be run.
  635.      *    @param boolean $is_dry        Dry run if true.
  636.      *    @access public
  637.      */
  638.     function makeDry($is_dry true{
  639.         for ($i 0$i count($this->reporters)$i++{
  640.             $this->reporters[$i]->makeDry($is_dry);
  641.         }
  642.     }
  643.  
  644.     /**
  645.      *    Accessor for current status. Will be false
  646.      *    if there have been any failures or exceptions.
  647.      *    If any reporter reports a failure, the whole
  648.      *    suite fails.
  649.      *    @return boolean        True if no failures.
  650.      *    @access public
  651.      */
  652.     function getStatus({
  653.         for ($i 0$i count($this->reporters)$i++{
  654.             if ($this->reporters[$i]->getStatus()) {
  655.                 return false;
  656.             }
  657.         }
  658.         return true;
  659.     }
  660.  
  661.     /**
  662.      *    The reporter has a veto on what should be run.
  663.      *    It requires all reporters to want to run the method.
  664.      *    @param string $test_case_name  name of test case.
  665.      *    @param string $method          Name of test method.
  666.      *    @access public
  667.      */
  668.     function shouldInvoke($test_case_name$method{
  669.         for ($i 0$i count($this->reporters)$i++{
  670.             if ($this->reporters[$i]->shouldInvoke($test_case_name$method)) {
  671.                 return false;
  672.             }
  673.         }
  674.         return true;
  675.     }
  676.  
  677.     /**
  678.      *    Every reporter gets a chance to wrap the invoker.
  679.      *    @param SimpleInvoker $invoker   Individual test runner.
  680.      *    @return SimpleInvoker           Wrapped test runner.
  681.      *    @access public
  682.      */
  683.     function createInvoker($invoker{
  684.         for ($i 0$i count($this->reporters)$i++{
  685.             $invoker $this->reporters[$i]->createInvoker($invoker);
  686.         }
  687.         return $invoker;
  688.     }
  689.     
  690.     /**
  691.      *    Gets the formatter for privateiables and other small
  692.      *    generic data items.
  693.      *    @return SimpleDumper          Formatter.
  694.      *    @access public
  695.      */
  696.     function getDumper({
  697.         return new SimpleDumper();
  698.     }
  699.  
  700.     /**
  701.      *    Paints the start of a group test.
  702.      *    @param string $test_name     Name of test or other label.
  703.      *    @param integer $size         Number of test cases starting.
  704.      *    @access public
  705.      */
  706.     function paintGroupStart($test_name$size{
  707.         for ($i 0$i count($this->reporters)$i++{
  708.             $this->reporters[$i]->paintGroupStart($test_name$size);
  709.         }
  710.     }
  711.  
  712.     /**
  713.      *    Paints the end of a group test.
  714.      *    @param string $test_name     Name of test or other label.
  715.      *    @access public
  716.      */
  717.     function paintGroupEnd($test_name{
  718.         for ($i 0$i count($this->reporters)$i++{
  719.             $this->reporters[$i]->paintGroupEnd($test_name);
  720.         }
  721.     }
  722.  
  723.     /**
  724.      *    Paints the start of a test case.
  725.      *    @param string $test_name     Name of test or other label.
  726.      *    @access public
  727.      */
  728.     function paintCaseStart($test_name{
  729.         for ($i 0$i count($this->reporters)$i++{
  730.             $this->reporters[$i]->paintCaseStart($test_name);
  731.         }
  732.     }
  733.  
  734.     /**
  735.      *    Paints the end of a test case.
  736.      *    @param string $test_name     Name of test or other label.
  737.      *    @access public
  738.      */
  739.     function paintCaseEnd($test_name{
  740.         for ($i 0$i count($this->reporters)$i++{
  741.             $this->reporters[$i]->paintCaseEnd($test_name);
  742.         }
  743.     }
  744.  
  745.     /**
  746.      *    Paints the start of a test method.
  747.      *    @param string $test_name     Name of test or other label.
  748.      *    @access public
  749.      */
  750.     function paintMethodStart($test_name{
  751.         for ($i 0$i count($this->reporters)$i++{
  752.             $this->reporters[$i]->paintMethodStart($test_name);
  753.         }
  754.     }
  755.  
  756.     /**
  757.      *    Paints the end of a test method.
  758.      *    @param string $test_name     Name of test or other label.
  759.      *    @access public
  760.      */
  761.     function paintMethodEnd($test_name{
  762.         for ($i 0$i count($this->reporters)$i++{
  763.             $this->reporters[$i]->paintMethodEnd($test_name);
  764.         }
  765.     }
  766.  
  767.     /**
  768.      *    Chains to the wrapped reporter.
  769.      *    @param string $message        Message is ignored.
  770.      *    @access public
  771.      */
  772.     function paintPass($message{
  773.         for ($i 0$i count($this->reporters)$i++{
  774.             $this->reporters[$i]->paintPass($message);
  775.         }
  776.     }
  777.  
  778.     /**
  779.      *    Chains to the wrapped reporter.
  780.      *    @param string $message        Message is ignored.
  781.      *    @access public
  782.      */
  783.     function paintFail($message{
  784.         for ($i 0$i count($this->reporters)$i++{
  785.             $this->reporters[$i]->paintFail($message);
  786.         }
  787.     }
  788.  
  789.     /**
  790.      *    Chains to the wrapped reporter.
  791.      *    @param string $message    Text of error formatted by
  792.      *                               the test case.
  793.      *    @access public
  794.      */
  795.     function paintError($message{
  796.         for ($i 0$i count($this->reporters)$i++{
  797.             $this->reporters[$i]->paintError($message);
  798.         }
  799.     }
  800.     
  801.     /**
  802.      *    Chains to the wrapped reporter.
  803.      *    @param Exception $exception    Exception to display.
  804.      *    @access public
  805.      */
  806.     function paintException($exception{
  807.         for ($i 0$i count($this->reporters)$i++{
  808.             $this->reporters[$i]->paintException($exception);
  809.         }
  810.     }
  811.  
  812.     /**
  813.      *    Prints the message for skipping tests.
  814.      *    @param string $message    Text of skip condition.
  815.      *    @access public
  816.      */
  817.     function paintSkip($message{
  818.         for ($i 0$i count($this->reporters)$i++{
  819.             $this->reporters[$i]->paintSkip($message);
  820.         }
  821.     }
  822.  
  823.     /**
  824.      *    Chains to the wrapped reporter.
  825.      *    @param string $message        Text to display.
  826.      *    @access public
  827.      */
  828.     function paintMessage($message{
  829.         for ($i 0$i count($this->reporters)$i++{
  830.             $this->reporters[$i]->paintMessage($message);
  831.         }
  832.     }
  833.  
  834.     /**
  835.      *    Chains to the wrapped reporter.
  836.      *    @param string $message        Text to display.
  837.      *    @access public
  838.      */
  839.     function paintFormattedMessage($message{
  840.         for ($i 0$i count($this->reporters)$i++{
  841.             $this->reporters[$i]->paintFormattedMessage($message);
  842.         }
  843.     }
  844.  
  845.     /**
  846.      *    Chains to the wrapped reporter.
  847.      *    @param string $type        Event type as text.
  848.      *    @param mixed $payload      Message or object.
  849.      *    @return boolean            Should return false if this
  850.      *                                type of signal should fail the
  851.      *                                test suite.
  852.      *    @access public
  853.      */
  854.     function paintSignal($type$payload{
  855.         for ($i 0$i count($this->reporters)$i++{
  856.             $this->reporters[$i]->paintSignal($type$payload);
  857.         }
  858.     }
  859. }
  860. ?>

Documentation generated on Thu, 01 Oct 2009 20:55:43 -0500 by phpDocumentor 1.4.2