Source for file TestResult.php
Documentation is available at TestResult.php
// +------------------------------------------------------------------------+
// +------------------------------------------------------------------------+
// | Copyright (c) 2002-2004 Sebastian Bergmann <sb@sebastian-bergmann.de>. |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License, |
// | that is available at http://www.php.net/license/3_0.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +------------------------------------------------------------------------+
// $Id: TestResult.php,v 1.5.2.1 2004/08/24 07:59:53 sebastian Exp $
require_once 'PHPUnit2/Framework/AssertionFailedError.php';
require_once 'PHPUnit2/Framework/IncompleteTest.php';
require_once 'PHPUnit2/Framework/Test.php';
require_once 'PHPUnit2/Framework/TestFailure.php';
require_once 'PHPUnit2/Framework/TestListener.php';
* A TestResult collects the results of executing a test case.
* @author Sebastian Bergmann <sb@sebastian-bergmann.de>
* @copyright Copyright © 2002-2004 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0
// {{{ public function addError(PHPUnit2_Framework_Test $test, Exception $e)
* Adds an error to the list of errors.
* The passed in exception caused the error.
* @param PHPUnit2_Framework_Test $test
public function addError(PHPUnit2_Framework_Test $test, Exception $e) {
$listener->addIncompleteTest ($test, $e);
$listener->addError ($test, $e);
// {{{ public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e)
* Adds a failure to the list of failures.
* The passed in exception caused the failure.
* @param PHPUnit2_Framework_Test $test
* @param PHPUnit2_Framework_AssertionFailedError $e
public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) {
$listener->addIncompleteTest ($test, $e);
$listener->addFailure ($test, $e);
// {{{ public function addListener(PHPUnit2_Framework_TestListener $listener)
* Registers a TestListener.
* @param PHPUnit2_Framework_TestListener
public function addListener(PHPUnit2_Framework_TestListener $listener) {
// {{{ public function endTest(PHPUnit2_Framework_Test $test)
* Informs the result that a test was completed.
* @param PHPUnit2_Framework_Test
public function endTest(PHPUnit2_Framework_Test $test) {
$listener->endTest ($test);
// {{{ public function allCompletlyImplemented()
* Returns true if no incomplete test occured.
// {{{ public function notImplementedCount()
* Gets the number of incomplete tests.
// {{{ public function notImplemented)
* Returns an Enumeration for the incomplete tests.
// {{{ public function errorCount()
* Gets the number of detected errors.
// {{{ public function errors()
* Returns an Enumeration for the errors.
// {{{ public function failureCount()
* Gets the number of detected failures.
// {{{ public function failures()
* Returns an Enumeration for the failures.
// {{{ public function removeListener(PHPUnit2_Framework_TestListener $listener)
* Unregisters a TestListener.
* @param PHPUnit2_Framework_TestListener $listener
public function removeListener(PHPUnit2_Framework_TestListener $listener) {
// {{{ public function run(PHPUnit2_Framework_Test $test)
* @param PHPUnit2_Framework_Test $test
public function run(PHPUnit2_Framework_Test $test) {
// {{{ public function runCount()
* Gets the number of run tests.
// {{{ public function shouldStop()
* Checks whether the test run should stop.
// {{{ public function startTest(PHPUnit2_Framework_Test $test)
* Informs the result that a test will be started.
* @param PHPUnit2_Framework_Test $test
public function startTest(PHPUnit2_Framework_Test $test) {
$this->runTests += $test->countTestCases ();
$listener->startTest ($test);
// {{{ public function stop()
* Marks that the test run should stop.
// {{{ public function wasSuccessful()
* Returns whether the entire test was successful or not.
* vim600: et sw=2 ts=2 fdm=marker
Documentation generated on Mon, 11 Mar 2019 13:55:58 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|