PHPUnit
[ class tree: PHPUnit ] [ index: PHPUnit ] [ all elements ]

Class: PHPUnit_TestSuite

Source Location: /PHPUnit-1.3.0/PHPUnit/TestSuite.php

Class Overview


A TestSuite is a Composite of Tests. It runs a collection of test cases.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>

Methods


Inherited Variables

Inherited Methods


Class Details

[line 59]
A TestSuite is a Composite of Tests. It runs a collection of test cases.

Here is an example using the dynamic test definition.

  1.  <?php
  2.  $suite = new PHPUnit_TestSuite();
  3.  $suite->addTest(new MathTest('testPass'));
  4.  ?>

Alternatively, a TestSuite can extract the tests to be run automatically. To do so you pass the classname of your TestCase class to the TestSuite constructor.

  1.  <?php
  2.  $suite = new TestSuite('classname');
  3.  ?>

This constructor creates a suite with all the methods starting with "test" that take no arguments.



[ Top ]


Method Detail

PHPUnit_TestSuite (Constructor)   [line 82]

PHPUnit_TestSuite PHPUnit_TestSuite( [mixed $test = FALSE])

Constructs a TestSuite.
  • Access: public

Parameters:

mixed   $test   — 

[ Top ]

addTest   [line 95]

void addTest( object &$test)

Adds a test to the suite.
  • Access: public

Parameters:

object   &$test   — 

[ Top ]

addTestSuite   [line 105]

void addTestSuite( string $testClass)

Adds the tests from the given class to the suite.
  • Access: public

Parameters:

string   $testClass   — 

[ Top ]

countTestCases   [line 130]

integer countTestCases( )

Counts the number of test cases that will be run by this test.
  • Access: public

[ Top ]

getName   [line 146]

string getName( )

Returns the name of the suite.
  • Access: public

[ Top ]

run   [line 156]

void run( object &$result)

Runs the tests and collects their result in a TestResult.
  • Access: public

Parameters:

object   &$result   — 

[ Top ]

runTest   [line 169]

void runTest( object &$test, object &$result)

Runs a test.
  • Access: public

Parameters:

object   &$test   — 
object   &$result   — 

[ Top ]

setName   [line 179]

void setName( string $name)

Sets the name of the suite.
  • Access: public

Parameters:

string   $name   — 

[ Top ]

testAt   [line 190]

object &testAt( integer $index)

Returns the test at the given index.
  • Access: public

Parameters:

integer   $index   — 

[ Top ]

testCount   [line 204]

integer testCount( )

Returns the number of tests in this suite.
  • Access: public

[ Top ]

tests   [line 214]

array &tests( )

Returns the tests as an enumeration.
  • Access: public

[ Top ]

toString   [line 224]

string toString( )

Returns a string representation of the test suite.
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:17:01 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.