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 1982 2010-03-28 11:57:54Z lastcraft $
  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 small generic data items.
  259.      *    @return SimpleDumper          Formatter.
  260.      *    @access public
  261.      */
  262.     function getDumper({
  263.         return new SimpleDumper();
  264.     }
  265.  
  266.     /**
  267.      *    Paints the start of a group test. Will also paint
  268.      *    the page header and footer if this is the
  269.      *    first test. Will stash the size if the first
  270.      *    start.
  271.      *    @param string $test_name   Name of test that is starting.
  272.      *    @param integer $size       Number of test cases starting.
  273.      *    @access public
  274.      */
  275.     function paintGroupStart($test_name$size{
  276.         if (isset($this->size)) {
  277.             $this->size $size;
  278.         }
  279.         if (count($this->test_stack== 0{
  280.             $this->paintHeader($test_name);
  281.         }
  282.         $this->test_stack[$test_name;
  283.     }
  284.  
  285.     /**
  286.      *    Paints the end of a group test. Will paint the page
  287.      *    footer if the stack of tests has unwound.
  288.      *    @param string $test_name   Name of test that is ending.
  289.      *    @param integer $progress   Number of test cases ending.
  290.      *    @access public
  291.      */
  292.     function paintGroupEnd($test_name{
  293.         array_pop($this->test_stack);
  294.         if (count($this->test_stack== 0{
  295.             $this->paintFooter($test_name);
  296.         }
  297.     }
  298.  
  299.     /**
  300.      *    Paints the start of a test case. Will also paint
  301.      *    the page header and footer if this is the
  302.      *    first test. Will stash the size if the first
  303.      *    start.
  304.      *    @param string $test_name   Name of test that is starting.
  305.      *    @access public
  306.      */
  307.     function paintCaseStart($test_name{
  308.         if (isset($this->size)) {
  309.             $this->size 1;
  310.         }
  311.         if (count($this->test_stack== 0{
  312.             $this->paintHeader($test_name);
  313.         }
  314.         $this->test_stack[$test_name;
  315.     }
  316.  
  317.     /**
  318.      *    Paints the end of a test case. Will paint the page
  319.      *    footer if the stack of tests has unwound.
  320.      *    @param string $test_name   Name of test that is ending.
  321.      *    @access public
  322.      */
  323.     function paintCaseEnd($test_name{
  324.         $this->progress++;
  325.         array_pop($this->test_stack);
  326.         if (count($this->test_stack== 0{
  327.             $this->paintFooter($test_name);
  328.         }
  329.     }
  330.  
  331.     /**
  332.      *    Paints the start of a test method.
  333.      *    @param string $test_name   Name of test that is starting.
  334.      *    @access public
  335.      */
  336.     function paintMethodStart($test_name{
  337.         $this->test_stack[$test_name;
  338.     }
  339.  
  340.     /**
  341.      *    Paints the end of a test method. Will paint the page
  342.      *    footer if the stack of tests has unwound.
  343.      *    @param string $test_name   Name of test that is ending.
  344.      *    @access public
  345.      */
  346.     function paintMethodEnd($test_name{
  347.         array_pop($this->test_stack);
  348.     }
  349.  
  350.     /**
  351.      *    Paints the test document header.
  352.      *    @param string $test_name     First test top level
  353.      *                                  to start.
  354.      *    @access public
  355.      *    @abstract
  356.      */
  357.     function paintHeader($test_name{
  358.     }
  359.  
  360.     /**
  361.      *    Paints the test document footer.
  362.      *    @param string $test_name        The top level test.
  363.      *    @access public
  364.      *    @abstract
  365.      */
  366.     function paintFooter($test_name{
  367.     }
  368.  
  369.     /**
  370.      *    Accessor for internal test stack. For
  371.      *    subclasses that need to see the whole test
  372.      *    history for display purposes.
  373.      *    @return array     List of methods in nesting order.
  374.      *    @access public
  375.      */
  376.     function getTestList({
  377.         return $this->test_stack;
  378.     }
  379.  
  380.     /**
  381.      *    Accessor for total test size in number
  382.      *    of test cases. Null until the first
  383.      *    test is started.
  384.      *    @return integer   Total number of cases at start.
  385.      *    @access public
  386.      */
  387.     function getTestCaseCount({
  388.         return $this->size;
  389.     }
  390.  
  391.     /**
  392.      *    Accessor for the number of test cases
  393.      *    completed so far.
  394.      *    @return integer   Number of ended cases.
  395.      *    @access public
  396.      */
  397.     function getTestCaseProgress({
  398.         return $this->progress;
  399.     }
  400.  
  401.     /**
  402.      *    Static check for running in the comand line.
  403.      *    @return boolean        True if CLI.
  404.      *    @access public
  405.      */
  406.     static function inCli({
  407.         return php_sapi_name(== 'cli';
  408.     }
  409. }
  410.  
  411. /**
  412.  *    For modifying the behaviour of the visual reporters.
  413.  *    @package SimpleTest
  414.  *    @subpackage UnitTester
  415.  */
  416.     protected $reporter;
  417.  
  418.     /**
  419.      *    Mediates between the reporter and the test case.
  420.      *    @param SimpleScorer $reporter       Reporter to receive events.
  421.      */
  422.     function __construct($reporter{
  423.         $this->reporter = $reporter;
  424.     }
  425.  
  426.     /**
  427.      *    Signals that the next evaluation will be a dry
  428.      *    run. That is, the structure events will be
  429.      *    recorded, but no tests will be run.
  430.      *    @param boolean $is_dry        Dry run if true.
  431.      *    @access public
  432.      */
  433.     function makeDry($is_dry true{
  434.         $this->reporter->makeDry($is_dry);
  435.     }
  436.  
  437.     /**
  438.      *    Accessor for current status. Will be false
  439.      *    if there have been any failures or exceptions.
  440.      *    Used for command line tools.
  441.      *    @return boolean        True if no failures.
  442.      *    @access public
  443.      */
  444.     function getStatus({
  445.         return $this->reporter->getStatus();
  446.     }
  447.  
  448.     /**
  449.      *    The nesting of the test cases so far. Not
  450.      *    all reporters have this facility.
  451.      *    @return array        Test list if accessible.
  452.      *    @access public
  453.      */
  454.     function getTestList({
  455.         if (method_exists($this->reporter'getTestList')) {
  456.             return $this->reporter->getTestList();
  457.         else {
  458.             return array();
  459.         }
  460.     }
  461.  
  462.     /**
  463.      *    The reporter has a veto on what should be run.
  464.      *    @param string $test_case_name  Name of test case.
  465.      *    @param string $method          Name of test method.
  466.      *    @return boolean                True if test should be run.
  467.      *    @access public
  468.      */
  469.     function shouldInvoke($test_case_name$method{
  470.         return $this->reporter->shouldInvoke($test_case_name$method);
  471.     }
  472.  
  473.     /**
  474.      *    Can wrap the invoker in preparation for running
  475.      *    a test.
  476.      *    @param SimpleInvoker $invoker   Individual test runner.
  477.      *    @return SimpleInvoker           Wrapped test runner.
  478.      *    @access public
  479.      */
  480.     function createInvoker($invoker{
  481.         return $this->reporter->createInvoker($invoker);
  482.     }
  483.     
  484.     /**
  485.      *    Gets the formatter for privateiables and other small
  486.      *    generic data items.
  487.      *    @return SimpleDumper          Formatter.
  488.      *    @access public
  489.      */
  490.     function getDumper({
  491.         return $this->reporter->getDumper();
  492.     }
  493.  
  494.     /**
  495.      *    Paints the start of a group test.
  496.      *    @param string $test_name     Name of test or other label.
  497.      *    @param integer $size         Number of test cases starting.
  498.      *    @access public
  499.      */
  500.     function paintGroupStart($test_name$size{
  501.         $this->reporter->paintGroupStart($test_name$size);
  502.     }
  503.  
  504.     /**
  505.      *    Paints the end of a group test.
  506.      *    @param string $test_name     Name of test or other label.
  507.      *    @access public
  508.      */
  509.     function paintGroupEnd($test_name{
  510.         $this->reporter->paintGroupEnd($test_name);
  511.     }
  512.  
  513.     /**
  514.      *    Paints the start of a test case.
  515.      *    @param string $test_name     Name of test or other label.
  516.      *    @access public
  517.      */
  518.     function paintCaseStart($test_name{
  519.         $this->reporter->paintCaseStart($test_name);
  520.     }
  521.  
  522.     /**
  523.      *    Paints the end of a test case.
  524.      *    @param string $test_name     Name of test or other label.
  525.      *    @access public
  526.      */
  527.     function paintCaseEnd($test_name{
  528.         $this->reporter->paintCaseEnd($test_name);
  529.     }
  530.  
  531.     /**
  532.      *    Paints the start of a test method.
  533.      *    @param string $test_name     Name of test or other label.
  534.      *    @access public
  535.      */
  536.     function paintMethodStart($test_name{
  537.         $this->reporter->paintMethodStart($test_name);
  538.     }
  539.  
  540.     /**
  541.      *    Paints the end of a test method.
  542.      *    @param string $test_name     Name of test or other label.
  543.      *    @access public
  544.      */
  545.     function paintMethodEnd($test_name{
  546.         $this->reporter->paintMethodEnd($test_name);
  547.     }
  548.  
  549.     /**
  550.      *    Chains to the wrapped reporter.
  551.      *    @param string $message        Message is ignored.
  552.      *    @access public
  553.      */
  554.     function paintPass($message{
  555.         $this->reporter->paintPass($message);
  556.     }
  557.  
  558.     /**
  559.      *    Chains to the wrapped reporter.
  560.      *    @param string $message        Message is ignored.
  561.      *    @access public
  562.      */
  563.     function paintFail($message{
  564.         $this->reporter->paintFail($message);
  565.     }
  566.  
  567.     /**
  568.      *    Chains to the wrapped reporter.
  569.      *    @param string $message    Text of error formatted by
  570.      *                               the test case.
  571.      *    @access public
  572.      */
  573.     function paintError($message{
  574.         $this->reporter->paintError($message);
  575.     }
  576.  
  577.     /**
  578.      *    Chains to the wrapped reporter.
  579.      *    @param Exception $exception        Exception to show.
  580.      *    @access public
  581.      */
  582.     function paintException($exception{
  583.         $this->reporter->paintException($exception);
  584.     }
  585.     
  586.     /**
  587.      *    Prints the message for skipping tests.
  588.      *    @param string $message    Text of skip condition.
  589.      *    @access public
  590.      */
  591.     function paintSkip($message{
  592.         $this->reporter->paintSkip($message);
  593.     }
  594.  
  595.     /**
  596.      *    Chains to the wrapped reporter.
  597.      *    @param string $message        Text to display.
  598.      *    @access public
  599.      */
  600.     function paintMessage($message{
  601.         $this->reporter->paintMessage($message);
  602.     }
  603.  
  604.     /**
  605.      *    Chains to the wrapped reporter.
  606.      *    @param string $message        Text to display.
  607.      *    @access public
  608.      */
  609.     function paintFormattedMessage($message{
  610.         $this->reporter->paintFormattedMessage($message);
  611.     }
  612.  
  613.     /**
  614.      *    Chains to the wrapped reporter.
  615.      *    @param string $type        Event type as text.
  616.      *    @param mixed $payload      Message or object.
  617.      *    @return boolean            Should return false if this
  618.      *                                type of signal should fail the
  619.      *                                test suite.
  620.      *    @access public
  621.      */
  622.     function paintSignal($type$payload{
  623.         $this->reporter->paintSignal($type$payload);
  624.     }
  625. }
  626.  
  627. /**
  628.  *    For sending messages to multiple reporters at
  629.  *    the same time.
  630.  *    @package SimpleTest
  631.  *    @subpackage UnitTester
  632.  */
  633.     private $reporters array();
  634.  
  635.     /**
  636.      *    Adds a reporter to the subscriber list.
  637.      *    @param SimpleScorer $reporter     Reporter to receive events.
  638.      *    @access public
  639.      */
  640.     function attachReporter($reporter{
  641.         $this->reporters[$reporter;
  642.     }
  643.  
  644.     /**
  645.      *    Signals that the next evaluation will be a dry
  646.      *    run. That is, the structure events will be
  647.      *    recorded, but no tests will be run.
  648.      *    @param boolean $is_dry        Dry run if true.
  649.      *    @access public
  650.      */
  651.     function makeDry($is_dry true{
  652.         for ($i 0$i count($this->reporters)$i++{
  653.             $this->reporters[$i]->makeDry($is_dry);
  654.         }
  655.     }
  656.  
  657.     /**
  658.      *    Accessor for current status. Will be false
  659.      *    if there have been any failures or exceptions.
  660.      *    If any reporter reports a failure, the whole
  661.      *    suite fails.
  662.      *    @return boolean        True if no failures.
  663.      *    @access public
  664.      */
  665.     function getStatus({
  666.         for ($i 0$i count($this->reporters)$i++{
  667.             if ($this->reporters[$i]->getStatus()) {
  668.                 return false;
  669.             }
  670.         }
  671.         return true;
  672.     }
  673.  
  674.     /**
  675.      *    The reporter has a veto on what should be run.
  676.      *    It requires all reporters to want to run the method.
  677.      *    @param string $test_case_name  name of test case.
  678.      *    @param string $method          Name of test method.
  679.      *    @access public
  680.      */
  681.     function shouldInvoke($test_case_name$method{
  682.         for ($i 0$i count($this->reporters)$i++{
  683.             if ($this->reporters[$i]->shouldInvoke($test_case_name$method)) {
  684.                 return false;
  685.             }
  686.         }
  687.         return true;
  688.     }
  689.  
  690.     /**
  691.      *    Every reporter gets a chance to wrap the invoker.
  692.      *    @param SimpleInvoker $invoker   Individual test runner.
  693.      *    @return SimpleInvoker           Wrapped test runner.
  694.      *    @access public
  695.      */
  696.     function createInvoker($invoker{
  697.         for ($i 0$i count($this->reporters)$i++{
  698.             $invoker $this->reporters[$i]->createInvoker($invoker);
  699.         }
  700.         return $invoker;
  701.     }
  702.     
  703.     /**
  704.      *    Gets the formatter for privateiables and other small
  705.      *    generic data items.
  706.      *    @return SimpleDumper          Formatter.
  707.      *    @access public
  708.      */
  709.     function getDumper({
  710.         return new SimpleDumper();
  711.     }
  712.  
  713.     /**
  714.      *    Paints the start of a group test.
  715.      *    @param string $test_name     Name of test or other label.
  716.      *    @param integer $size         Number of test cases starting.
  717.      *    @access public
  718.      */
  719.     function paintGroupStart($test_name$size{
  720.         for ($i 0$i count($this->reporters)$i++{
  721.             $this->reporters[$i]->paintGroupStart($test_name$size);
  722.         }
  723.     }
  724.  
  725.     /**
  726.      *    Paints the end of a group test.
  727.      *    @param string $test_name     Name of test or other label.
  728.      *    @access public
  729.      */
  730.     function paintGroupEnd($test_name{
  731.         for ($i 0$i count($this->reporters)$i++{
  732.             $this->reporters[$i]->paintGroupEnd($test_name);
  733.         }
  734.     }
  735.  
  736.     /**
  737.      *    Paints the start of a test case.
  738.      *    @param string $test_name     Name of test or other label.
  739.      *    @access public
  740.      */
  741.     function paintCaseStart($test_name{
  742.         for ($i 0$i count($this->reporters)$i++{
  743.             $this->reporters[$i]->paintCaseStart($test_name);
  744.         }
  745.     }
  746.  
  747.     /**
  748.      *    Paints the end of a test case.
  749.      *    @param string $test_name     Name of test or other label.
  750.      *    @access public
  751.      */
  752.     function paintCaseEnd($test_name{
  753.         for ($i 0$i count($this->reporters)$i++{
  754.             $this->reporters[$i]->paintCaseEnd($test_name);
  755.         }
  756.     }
  757.  
  758.     /**
  759.      *    Paints the start of a test method.
  760.      *    @param string $test_name     Name of test or other label.
  761.      *    @access public
  762.      */
  763.     function paintMethodStart($test_name{
  764.         for ($i 0$i count($this->reporters)$i++{
  765.             $this->reporters[$i]->paintMethodStart($test_name);
  766.         }
  767.     }
  768.  
  769.     /**
  770.      *    Paints the end of a test method.
  771.      *    @param string $test_name     Name of test or other label.
  772.      *    @access public
  773.      */
  774.     function paintMethodEnd($test_name{
  775.         for ($i 0$i count($this->reporters)$i++{
  776.             $this->reporters[$i]->paintMethodEnd($test_name);
  777.         }
  778.     }
  779.  
  780.     /**
  781.      *    Chains to the wrapped reporter.
  782.      *    @param string $message        Message is ignored.
  783.      *    @access public
  784.      */
  785.     function paintPass($message{
  786.         for ($i 0$i count($this->reporters)$i++{
  787.             $this->reporters[$i]->paintPass($message);
  788.         }
  789.     }
  790.  
  791.     /**
  792.      *    Chains to the wrapped reporter.
  793.      *    @param string $message        Message is ignored.
  794.      *    @access public
  795.      */
  796.     function paintFail($message{
  797.         for ($i 0$i count($this->reporters)$i++{
  798.             $this->reporters[$i]->paintFail($message);
  799.         }
  800.     }
  801.  
  802.     /**
  803.      *    Chains to the wrapped reporter.
  804.      *    @param string $message    Text of error formatted by
  805.      *                               the test case.
  806.      *    @access public
  807.      */
  808.     function paintError($message{
  809.         for ($i 0$i count($this->reporters)$i++{
  810.             $this->reporters[$i]->paintError($message);
  811.         }
  812.     }
  813.     
  814.     /**
  815.      *    Chains to the wrapped reporter.
  816.      *    @param Exception $exception    Exception to display.
  817.      *    @access public
  818.      */
  819.     function paintException($exception{
  820.         for ($i 0$i count($this->reporters)$i++{
  821.             $this->reporters[$i]->paintException($exception);
  822.         }
  823.     }
  824.  
  825.     /**
  826.      *    Prints the message for skipping tests.
  827.      *    @param string $message    Text of skip condition.
  828.      *    @access public
  829.      */
  830.     function paintSkip($message{
  831.         for ($i 0$i count($this->reporters)$i++{
  832.             $this->reporters[$i]->paintSkip($message);
  833.         }
  834.     }
  835.  
  836.     /**
  837.      *    Chains to the wrapped reporter.
  838.      *    @param string $message        Text to display.
  839.      *    @access public
  840.      */
  841.     function paintMessage($message{
  842.         for ($i 0$i count($this->reporters)$i++{
  843.             $this->reporters[$i]->paintMessage($message);
  844.         }
  845.     }
  846.  
  847.     /**
  848.      *    Chains to the wrapped reporter.
  849.      *    @param string $message        Text to display.
  850.      *    @access public
  851.      */
  852.     function paintFormattedMessage($message{
  853.         for ($i 0$i count($this->reporters)$i++{
  854.             $this->reporters[$i]->paintFormattedMessage($message);
  855.         }
  856.     }
  857.  
  858.     /**
  859.      *    Chains to the wrapped reporter.
  860.      *    @param string $type        Event type as text.
  861.      *    @param mixed $payload      Message or object.
  862.      *    @return boolean            Should return false if this
  863.      *                                type of signal should fail the
  864.      *                                test suite.
  865.      *    @access public
  866.      */
  867.     function paintSignal($type$payload{
  868.         for ($i 0$i count($this->reporters)$i++{
  869.             $this->reporters[$i]->paintSignal($type$payload);
  870.         }
  871.     }
  872. }
  873. ?>

Documentation generated on Sun, 31 Oct 2010 16:32:17 -0500 by phpDocumentor 1.4.3