[ Index ]
 

Code source de LifeType 1.2.4

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/class/test/ -> testrunner.class.php (sommaire)

\defgroup Test Unit testing in LifeType is implemented based on PHPUnit and provides a mechanism for users who write customizations or work with the LifeType core to make sure that their changes do not break the behaviour of the code being modified.

Poids: 198 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 1 fois
Nécessite: 0 fichiers

Définit 1 class

TestRunner:: (5 méthodes):
  TestRunner()
  addListener()
  run()
  getTestSuites()
  _findClasses()


Classe: TestRunner  - X-Ref

\ingroup Test

This class takes care of running all unit tests in LifeType, as many as there are. This class
process the contents of the class/test/tests/ folder and loads all the classes whose name
ends with "_test.class.php" and uses PHPUnit to process them.

The correct way to use this class is as follows:

<pre>
$r = new TestRunner();
$result = $r->run();
print( $result->toHTML());
</pre>

In order to add new test cases, please reproduce the class/ structure in the class/test/tests folder
(so that it is easier to tell which class each one of the tests is taking care of) and call your class
ClassThatIsBeingTested_test.class.php. The TestRunner class will load them automatically and execute any
methods whose name starts with "test". Please the PHPUnit documentation for more details on how to
implement test cases.
TestRunner( $folders = TEST_CLASS_FOLDER, $pattern = TEST_CLASS_NAME_PATTERN )   X-Ref
Constructor.

param: folder Where test suites are stored. Defaults to class/test/tests (relative
param: pattern Pattern that will be used to check whether a file in folder $folder

addListener( &$listener )   X-Ref
Adds a test listener


run( $suite = Array( "all" )   X-Ref
Runs a test suite, or all of them if no test suite name is given

param: suite The suite name, "all" or empty to run all suites
return: Returns a PHPUnit_TestResult object containing information about which

getTestSuites()   X-Ref
Returns an associative array with the names of all test suites available. The
name of a test suite consists of its class name minus the "_test" suffix, although
The TestRunner::run() method can take both naming schemes (with and without suffix)

return: An associative array with the name of all suites

_findClasses( $folders, $pattern = "*" )   X-Ref




Généré le : Mon Nov 26 21:04:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics