[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/lib/simpletestlib/ -> reporter.php (summary)

base include file for SimpleTest

Version: $Id$
File Size: 426 lines (16 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

HtmlReporter:: (11 methods):
  HtmlReporter()
  paintHeader()
  sendNoCacheHeaders()
  _getCss()
  paintFooter()
  paintFail()
  paintError()
  paintException()
  paintSkip()
  paintFormattedMessage()
  _htmlEntities()

TextReporter:: (8 methods):
  TextReporter()
  paintHeader()
  paintFooter()
  paintFail()
  paintError()
  paintException()
  paintSkip()
  paintFormattedMessage()

SelectiveReporter:: (8 methods):
  SelectiveReporter()
  _isCaseMatch()
  _isTestMatch()
  shouldInvoke()
  paintGroupStart()
  paintGroupEnd()
  paintCaseStart()
  paintCaseEnd()


Class: HtmlReporter  - X-Ref

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

HtmlReporter($character_set = 'ISO-8859-1')   X-Ref
Does nothing yet. The first output will
be sent on the first test start. For use
by a web browser.


paintHeader($test_name)   X-Ref
Paints the top of the web page setting the
title to the name of the starting test.

param: string $test_name      Name class of test.

sendNoCacheHeaders()   X-Ref
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.


_getCss()   X-Ref
Paints the CSS. Add additional styles here.

return: string            CSS code as text.

paintFooter($test_name)   X-Ref
Paints the end of the test with a summary of
the passes and failures.

param: string $test_name        Name class of test.

paintFail($message)   X-Ref
Paints the test failure with a breadcrumbs
trail of the nesting test suites below the
top level test.

param: string $message    Failure message displayed in

paintError($message)   X-Ref
Paints a PHP error.

param: string $message        Message is ignored.

paintException($exception)   X-Ref
Paints a PHP exception.

param: Exception $exception        Exception to display.

paintSkip($message)   X-Ref
Prints the message for skipping tests.

param: string $message    Text of skip condition.

paintFormattedMessage($message)   X-Ref
Paints formatted text such as dumped variables.

param: string $message        Text to show.

_htmlEntities($message)   X-Ref
Character set adjusted entity conversion.

param: string $message    Plain text or Unicode message.
return: string            Browser readable message.

Class: TextReporter  - X-Ref

Sample minimal test displayer. Generates only
failure messages and a pass count. For command
line use. I've tried to make it look like JUnit,
but I wanted to output the errors as they arrived
which meant dropping the dots.

TextReporter()   X-Ref
Does nothing yet. The first output will
be sent on the first test start.


paintHeader($test_name)   X-Ref
Paints the title only.

param: string $test_name        Name class of test.

paintFooter($test_name)   X-Ref
Paints the end of the test with a summary of
the passes and failures.

param: string $test_name        Name class of test.

paintFail($message)   X-Ref
Paints the test failure as a stack trace.

param: string $message    Failure message displayed in

paintError($message)   X-Ref
Paints a PHP error or exception.

param: string $message        Message to be shown.

paintException($exception)   X-Ref
Paints a PHP error or exception.

param: Exception $exception      Exception to describe.

paintSkip($message)   X-Ref
Prints the message for skipping tests.

param: string $message    Text of skip condition.

paintFormattedMessage($message)   X-Ref
Paints formatted text such as dumped variables.

param: string $message        Text to show.

Class: SelectiveReporter  - X-Ref

Runs just a single test group, a single case or
even a single test within that case.

SelectiveReporter(&$reporter, $just_this_case = false, $just_this_test = false)   X-Ref
Selects the test case or group to be run,
and optionally a specific test.

param: SimpleScorer $reporter    Reporter to receive events.
param: string $just_this_case    Only this case or group will run.
param: string $just_this_test    Only this test method will run.

_isCaseMatch($test_case)   X-Ref
Compares criteria to actual the case/group name.

param: string $test_case    The incoming test.
return: boolean             True if matched.

_isTestMatch($method)   X-Ref
Compares criteria to actual the test name.

param: string $method       The incoming test method.
return: boolean             True if matched.

shouldInvoke($test_case, $method)   X-Ref
Veto everything that doesn't match the method wanted.

param: string $test_case       Name of test case.
param: string $method          Name of test method.
return: boolean                True if test should be run.

paintGroupStart($test_case, $size)   X-Ref
Paints the start of a group test.

param: string $test_case     Name of test or other label.
param: integer $size         Number of test cases starting.

paintGroupEnd($test_case)   X-Ref
Paints the end of a group test.

param: string $test_case     Name of test or other label.

paintCaseStart($test_case)   X-Ref
Paints the start of a test case.

param: string $test_case     Name of test or other label.

paintCaseEnd($test_case)   X-Ref
Paints the end of a test case.

param: string $test_case     Name of test or other label.



Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7