Source for file BaseTestRunner.php
Documentation is available at BaseTestRunner.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: BaseTestRunner.php,v 1.5.2.2 2004/09/27 07:54:06 sebastian Exp $
require_once 'PHPUnit2/Framework/AssertionFailedError.php';
require_once 'PHPUnit2/Framework/TestListener.php';
require_once 'PHPUnit2/Framework/TestSuite.php';
require_once 'PHPUnit2/Runner/StandardTestSuiteLoader.php';
require_once 'PHPUnit2/Runner/TestRunListener.php';
* Base class for all test runners.
* @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
const SUITE_METHODNAME = 'suite';
// {{{ public function addError(PHPUnit2_Framework_Test $test, Exception $e)
* @param PHPUnit2_Framework_Test $test
public function addError(PHPUnit2_Framework_Test $test, Exception $e) {
// {{{ public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e)
* @param PHPUnit2_Framework_Test $test
* @param PHPUnit2_Framework_AssertionFailedError $e
public function addFailure(PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e) {
// {{{ public function addIncompleteTest(PHPUnit2_Framework_Test $test, Exception $e)
* @param PHPUnit2_Framework_Test $test
// {{{ public function endTest(PHPUnit2_Framework_Test $test)
* @param PHPUnit2_Framework_Test $test
public function endTest(PHPUnit2_Framework_Test $test) {
// {{{ public function getLoader()
* Returns the loader to be used.
* @return PHPUnit2_Runner_TestSuiteLoader
// {{{ public function getTest($suiteClassName)
* Returns the Test corresponding to the given suite.
* This is a template method, subclasses override
* the runFailed() and clearStatus() methods.
* @param string $suiteClassName
* @return PHPUnit2_Framework_Test
public function getTest($suiteClassName) {
$suiteMethod = $testClass->getMethod (self ::SUITE_METHODNAME );
if (!$suiteMethod->isStatic ()) {
'suite() method must be static.'
$test = $suiteMethod->invoke (NULL );
catch (ReflectionException $e) {
"Failed to invoke suite() method.\n%s",
catch (ReflectionException $e) {
// {{{ public function startTest(PHPUnit2_Framework_Test $test)
* @param PHPUnit2_Framework_Test $test
public function startTest(PHPUnit2_Framework_Test $test) {
// {{{ public abstract function testEnded($testName)
* @param string $testName
public abstract function testEnded($testName);
// {{{ public abstract function testFailed($status, PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e)
* @param PHPUnit2_Framework_Test $test
* @param PHPUnit2_Framework_AssertionFailedError $e
public abstract function testFailed($status, PHPUnit2_Framework_Test $test, PHPUnit2_Framework_AssertionFailedError $e);
// {{{ public abstract function testStarted($testName)
* @param string $testName
// {{{ protected abstract function runFailed($message)
* Override to define how to handle a failed loading of
protected abstract function runFailed($message);
// {{{ protected function loadSuiteClass($suiteClassName)
* Returns the loaded ReflectionClass for a suite name.
* @param string $suiteClassName
* @return ReflectionClass
return $this->getLoader()->load ($suiteClassName);
// {{{ protected function clearStatus()
* Clears the status message.
* 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.
|