Class WebUnitReporter

Description

Sample minimal test displayer. Generates only failure messages and a pass count.

Located in /extensions/webunit_reporter.php (line 78)

SimpleScorer
   |
   --SimpleReporter
      |
      --WebUnitReporter
Variable Summary
 string $path
Method Summary
 WebUnitReporter __construct ([ $path = '../ui/'])
 string outputScript (string $script)
 void paintCaseStart (string $test_name)
 void paintException (string $message)
 void paintFail (string $message)
 void paintFooter (string $test_name)
 void paintFormattedMessage (string $message)
 void paintGroupStart (string $test_name, integer $size)
 void paintHeader (string $test_name)
 void paintMethodEnd (string $test_name)
 void paintMethodStart (string $test_name)
 string toJsString (string $str, [ $preserveCr = false])
 string _getCss ()
Variables
string $path (line 84)
  • var: Base directory for PUnit script, images and style sheets. Needs to be a relative path from where the test scripts are run (and obviously, visible in the document root).
Methods
Constructor __construct (line 92)

Does nothing yet. The first output will be sent on the first test start. For use by a web browser.

  • access: public
WebUnitReporter __construct ([ $path = '../ui/'])
  • $path

Redefinition of:
SimpleReporter::__construct()
Starts the display with no results in.
outputScript (line 262)

Returns the script passed in wrapped in script tags.

  • return: the script wrapped with script tags
string outputScript (string $script)
  • string $script: the script to output
paintCaseStart (line 197)

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 start.

  • access: public
void paintCaseStart (string $test_name)
  • string $test_name: Name of test that is starting.

Redefinition of:
SimpleReporter::paintCaseStart()
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 start.
paintException (line 246)

Paints a PHP error or exception.

  • abstract:
  • access: public
void paintException (string $message)
  • string $message: Message is ignored.

Redefinition of:
SimpleScorer::paintException()
Deals with PHP 5 throwing an exception.
paintFail (line 230)

Paints the test failure with a breadcrumbs trail of the nesting test suites below the top level test.

  • access: public
void paintFail (string $message)
  • string $message: Failure message displayed in the context of the other tests.

Redefinition of:
SimpleScorer::paintFail()
Increments the fail count.
paintFooter (line 147)

Paints the end of the test with a summary of the passes and failures.

  • access: public
void paintFooter (string $test_name)
  • string $test_name: Name class of test.

Redefinition of:
SimpleReporter::paintFooter()
Paints the test document footer.
paintFormattedMessage (line 171)

Paints formatted text such as dumped variables.

  • access: public
void paintFormattedMessage (string $message)
  • string $message: Text to show.

Redefinition of:
SimpleScorer::paintFormattedMessage()
Paints a formatted ASCII message such as a privateiable dump.
paintGroupStart (line 184)

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 start.

  • access: public
void paintGroupStart (string $test_name, integer $size)
  • string $test_name: Name of test that is starting.
  • integer $size: Number of test cases starting.

Redefinition of:
SimpleReporter::paintGroupStart()
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 start.
paintHeader (line 103)

Paints the top of the web page setting the title to the name of the starting test.

  • access: public
void paintHeader (string $test_name)
  • string $test_name: Name class of test.

Redefinition of:
SimpleReporter::paintHeader()
Paints the test document header.
paintMethodEnd (line 218)

Paints the end of a test method.

  • access: public
void paintMethodEnd (string $test_name)
  • string $test_name: Name of test that is ending.

Redefinition of:
SimpleReporter::paintMethodEnd()
Paints the end of a test method. Will paint the page footer if the stack of tests has unwound.
paintMethodStart (line 208)

Paints the start of a test method.

  • access: public
void paintMethodStart (string $test_name)
  • string $test_name: Name of test that is starting.

Redefinition of:
SimpleReporter::paintMethodStart()
Paints the start of a test method.
sendNoCacheHeaders (line 124)

Send the headers necessary to ensure the page is reloaded on every request. Otherwise you could be scratching your head over out of date test data.

  • access: public
void sendNoCacheHeaders ()
toJsString (line 273)

Transform a string into a format acceptable to JavaScript

string toJsString (string $str, [ $preserveCr = false])
  • string $str: the string to transform
  • $preserveCr
_getCss (line 137)

Paints the CSS. Add additional styles here.

  • return: CSS code as text.
  • access: protected
string _getCss ()

Inherited Methods

Inherited From SimpleReporter

 SimpleReporter::__construct()
 SimpleReporter::getDumper()
 SimpleReporter::getTestCaseCount()
 SimpleReporter::getTestCaseProgress()
 SimpleReporter::getTestList()
 SimpleReporter::inCli()
 SimpleReporter::paintCaseEnd()
 SimpleReporter::paintCaseStart()
 SimpleReporter::paintFooter()
 SimpleReporter::paintGroupEnd()
 SimpleReporter::paintGroupStart()
 SimpleReporter::paintHeader()
 SimpleReporter::paintMethodEnd()
 SimpleReporter::paintMethodStart()

Inherited From SimpleScorer

 SimpleScorer::__construct()
 SimpleScorer::createInvoker()
 SimpleScorer::getExceptionCount()
 SimpleScorer::getFailCount()
 SimpleScorer::getPassCount()
 SimpleScorer::getStatus()
 SimpleScorer::makeDry()
 SimpleScorer::paintCaseEnd()
 SimpleScorer::paintCaseStart()
 SimpleScorer::paintError()
 SimpleScorer::paintException()
 SimpleScorer::paintFail()
 SimpleScorer::paintFormattedMessage()
 SimpleScorer::paintGroupEnd()
 SimpleScorer::paintGroupStart()
 SimpleScorer::paintMessage()
 SimpleScorer::paintMethodEnd()
 SimpleScorer::paintMethodStart()
 SimpleScorer::paintPass()
 SimpleScorer::paintSignal()
 SimpleScorer::paintSkip()
 SimpleScorer::shouldInvoke()

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