Source for file scorer.php
Documentation is available at scorer.php
* base include file for SimpleTest
* @version $Id: scorer.php 1723 2008-04-08 00:34:10Z lastcraft $
require_once(dirname(__FILE__
) .
'/invoker.php');
* Can receive test events and display them. Display
* is achieved by making display methods available
* and visiting the incoming event.
* Starts the test run with no results.
* Signals that the next evaluation will be a dry
* run. That is, the structure events will be
* recorded, but no tests will be run.
* @param boolean $is_dry Dry run if true.
* The reporter has a veto on what should be run.
* @param string $test_case_name name of test case.
* @param string $method Name of test method.
* Can wrap the invoker in preperation for running
* @param SimpleInvoker $invoker Individual test runner.
* @return SimpleInvoker Wrapped test runner.
* Accessor for current status. Will be false
* if there have been any failures or exceptions.
* Used for command line tools.
* @return boolean True if no failures.
* Paints the start of a group test.
* @param string $test_name Name of test or other label.
* @param integer $size Number of test cases starting.
* Paints the end of a group test.
* @param string $test_name Name of test or other label.
* Paints the start of a test case.
* @param string $test_name Name of test or other label.
* Paints the end of a test case.
* @param string $test_name Name of test or other label.
* Paints the start of a test method.
* @param string $test_name Name of test or other label.
* Paints the end of a test method.
* @param string $test_name Name of test or other label.
* Increments the pass count.
* @param string $message Message is ignored.
* Increments the fail count.
* @param string $message Message is ignored.
* Deals with PHP 4 throwing an error.
* @param string $message Text of error formatted by
* Deals with PHP 5 throwing an exception.
* @param Exception $exception The actual exception thrown.
* Prints the message for skipping tests.
* @param string $message Text of skip condition.
* Accessor for the number of passes so far.
* @return integer Number of passes.
* Accessor for the number of fails so far.
* @return integer Number of fails.
* Accessor for the number of untrapped errors
* @return integer Number of exceptions.
* Paints a simple supplementary message.
* @param string $message Text to display.
* Paints a formatted ASCII message such as a
* @param string $message Text to display.
* By default just ignores user generated events.
* @param string $type Event type as text.
* @param mixed $payload Message or object.
* Recipient of generated test messages that can display
* page footers and headers. Also keeps track of the
* test nesting. This is the main base class on which
* to build the finished test (page based) displays.
* Starts the display with no results in.
* Gets the formatter for variables and other small
* @return SimpleDumper Formatter.
* Paints the start of a group test. Will also paint
* the page header and footer if this is the
* first test. Will stash the size if the first
* @param string $test_name Name of test that is starting.
* @param integer $size Number of test cases starting.
if (! isset
($this->_size)) {
* Paints the end of a group test. Will paint the page
* footer if the stack of tests has unwound.
* @param string $test_name Name of test that is ending.
* @param integer $progress Number of test cases ending.
* Paints the start of a test case. Will also paint
* the page header and footer if this is the
* first test. Will stash the size if the first
* @param string $test_name Name of test that is starting.
if (! isset
($this->_size)) {
* Paints the end of a test case. Will paint the page
* footer if the stack of tests has unwound.
* @param string $test_name Name of test that is ending.
* Paints the start of a test method.
* @param string $test_name Name of test that is starting.
* Paints the end of a test method. Will paint the page
* footer if the stack of tests has unwound.
* @param string $test_name Name of test that is ending.
* Paints the test document header.
* @param string $test_name First test top level
* Paints the test document footer.
* @param string $test_name The top level test.
* Accessor for internal test stack. For
* subclasses that need to see the whole test
* history for display purposes.
* @return array List of methods in nesting order.
* Accessor for total test size in number
* of test cases. Null until the first
* @return integer Total number of cases at start.
* Accessor for the number of test cases
* @return integer Number of ended cases.
* Static check for running in the comand line.
* @return boolean True if CLI.
* For modifying the behaviour of the visual reporters.
* Mediates between the reporter and the test case.
* @param SimpleScorer $reporter Reporter to receive events.
* Signals that the next evaluation will be a dry
* run. That is, the structure events will be
* recorded, but no tests will be run.
* @param boolean $is_dry Dry run if true.
* Accessor for current status. Will be false
* if there have been any failures or exceptions.
* Used for command line tools.
* @return boolean True if no failures.
* The reporter has a veto on what should be run.
* @param string $test_case_name name of test case.
* @param string $method Name of test method.
* @return boolean True if test should be run.
return $this->_reporter->shouldInvoke($test_case_name, $method);
* Can wrap the invoker in preperation for running
* @param SimpleInvoker $invoker Individual test runner.
* @return SimpleInvoker Wrapped test runner.
return $this->_reporter->createInvoker($invoker);
* Gets the formatter for variables and other small
* @return SimpleDumper Formatter.
* Paints the start of a group test.
* @param string $test_name Name of test or other label.
* @param integer $size Number of test cases starting.
$this->_reporter->paintGroupStart($test_name, $size);
* Paints the end of a group test.
* @param string $test_name Name of test or other label.
* Paints the start of a test case.
* @param string $test_name Name of test or other label.
$this->_reporter->paintCaseStart($test_name);
* Paints the end of a test case.
* @param string $test_name Name of test or other label.
* Paints the start of a test method.
* @param string $test_name Name of test or other label.
$this->_reporter->paintMethodStart($test_name);
* Paints the end of a test method.
* @param string $test_name Name of test or other label.
$this->_reporter->paintMethodEnd($test_name);
* Chains to the wrapped reporter.
* @param string $message Message is ignored.
* Chains to the wrapped reporter.
* @param string $message Message is ignored.
* Chains to the wrapped reporter.
* @param string $message Text of error formatted by
* Chains to the wrapped reporter.
* @param Exception $exception Exception to show.
$this->_reporter->paintException($exception);
* Prints the message for skipping tests.
* @param string $message Text of skip condition.
* Chains to the wrapped reporter.
* @param string $message Text to display.
* Chains to the wrapped reporter.
* @param string $message Text to display.
$this->_reporter->paintFormattedMessage($message);
* Chains to the wrapped reporter.
* @param string $type Event type as text.
* @param mixed $payload Message or object.
* @return boolean Should return false if this
* type of signal should fail the
$this->_reporter->paintSignal($type, $payload);
* For sending messages to multiple reporters at
* Adds a reporter to the subscriber list.
* @param SimpleScorer $reporter Reporter to receive events.
* Signals that the next evaluation will be a dry
* run. That is, the structure events will be
* recorded, but no tests will be run.
* @param boolean $is_dry Dry run if true.
* Accessor for current status. Will be false
* if there have been any failures or exceptions.
* If any reporter reports a failure, the whole
* @return boolean True if no failures.
* The reporter has a veto on what should be run.
* It requires all reporters to want to run the method.
* @param string $test_case_name name of test case.
* @param string $method Name of test method.
if (! $this->_reporters[$i]->shouldInvoke($test_case_name, $method)) {
* Every reporter gets a chance to wrap the invoker.
* @param SimpleInvoker $invoker Individual test runner.
* @return SimpleInvoker Wrapped test runner.
$invoker =
&$this->_reporters[$i]->createInvoker($invoker);
* Gets the formatter for variables and other small
* @return SimpleDumper Formatter.
* Paints the start of a group test.
* @param string $test_name Name of test or other label.
* @param integer $size Number of test cases starting.
$this->_reporters[$i]->paintGroupStart($test_name, $size);
* Paints the end of a group test.
* @param string $test_name Name of test or other label.
* Paints the start of a test case.
* @param string $test_name Name of test or other label.
$this->_reporters[$i]->paintCaseStart($test_name);
* Paints the end of a test case.
* @param string $test_name Name of test or other label.
* Paints the start of a test method.
* @param string $test_name Name of test or other label.
$this->_reporters[$i]->paintMethodStart($test_name);
* Paints the end of a test method.
* @param string $test_name Name of test or other label.
$this->_reporters[$i]->paintMethodEnd($test_name);
* Chains to the wrapped reporter.
* @param string $message Message is ignored.
* Chains to the wrapped reporter.
* @param string $message Message is ignored.
* Chains to the wrapped reporter.
* @param string $message Text of error formatted by
* Chains to the wrapped reporter.
* @param Exception $exception Exception to display.
$this->_reporters[$i]->paintException($exception);
* Prints the message for skipping tests.
* @param string $message Text of skip condition.
* Chains to the wrapped reporter.
* @param string $message Text to display.
* Chains to the wrapped reporter.
* @param string $message Text to display.
$this->_reporters[$i]->paintFormattedMessage($message);
* Chains to the wrapped reporter.
* @param string $type Event type as text.
* @param mixed $payload Message or object.
* @return boolean Should return false if this
* type of signal should fail the
$this->_reporters[$i]->paintSignal($type, $payload);
Documentation generated on Sun, 04 May 2008 09:22:04 -0500 by phpDocumentor 1.3.0