BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
PHPUnit_Framework_TestSuite Class Reference
Inheritance diagram for PHPUnit_Framework_TestSuite:
Collaboration diagram for PHPUnit_Framework_TestSuite:

Public Member Functions

 __construct ($theClass= '', $name= '')
 
 toString ()
 
 addTest (PHPUnit_Framework_Test $test, $groups=array())
 
 addTestSuite ($testClass)
 
 addTestFile ($filename)
 
 addTestFiles ($filenames)
 
 count ($preferCache=false)
 
 getName ()
 
 getGroups ()
 
 getGroupDetails ()
 
 setGroupDetails (array $groups)
 
 run (PHPUnit_Framework_TestResult $result=null)
 
 setRunTestInSeparateProcess ($runTestInSeparateProcess)
 
 runTest (PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result)
 
 setName ($name)
 
 testAt ($index)
 
 tests ()
 
 setTests (array $tests)
 
 markTestSuiteSkipped ($message= '')
 
 setDisallowChangesToGlobalState ($disallowChangesToGlobalState)
 
 setBackupGlobals ($backupGlobals)
 
 setBackupStaticAttributes ($backupStaticAttributes)
 
 getIterator ()
 
 injectFilter (PHPUnit_Runner_Filter_Factory $filter)
 
- Public Member Functions inherited from Countable
 count ()
 

Static Public Member Functions

static createTest (ReflectionClass $theClass, $name)
 
static isTestMethod (ReflectionMethod $method)
 

Protected Member Functions

 createResult ()
 
 addTestMethod (ReflectionClass $class, ReflectionMethod $method)
 
 setUp ()
 
 tearDown ()
 

Static Protected Member Functions

static warning ($message)
 
static skipTest ($class, $methodName, $message)
 
static incompleteTest ($class, $methodName, $message)
 

Protected Attributes

 $backupGlobals = null
 
 $backupStaticAttributes = null
 
 $runTestInSeparateProcess = false
 
 $name = ''
 
 $groups = array()
 
 $tests = array()
 
 $numTests = -1
 
 $testCase = false
 
 $foundClasses = array()
 

Detailed Description

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

Since
Class available since Release 2.0.0

Constructor & Destructor Documentation

PHPUnit_Framework_TestSuite::__construct (   $theClass = '',
  $name = '' 
)

Constructs a new TestSuite:

Parameters
mixed$theClass
string$name
Exceptions
PHPUnit_Framework_Exception

Member Function Documentation

PHPUnit_Framework_TestSuite::addTest ( PHPUnit_Framework_Test  $test,
  $groups = array() 
)

Adds a test to the suite.

Parameters
PHPUnit_Framework_Test$test
array$groups
PHPUnit_Framework_TestSuite::addTestFile (   $filename)

Wraps both addTest() and addTestSuite as well as the separate import statements for the user's convenience.

If the named file cannot be read or there are no new tests that can be added, a PHPUnit_Framework_Warning will be created instead, leaving the current test run untouched.

Parameters
string$filename
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 2.3.0
PHPUnit_Framework_TestSuite::addTestFiles (   $filenames)

Wrapper for addTestFile() that adds multiple test files.

Parameters
array | Iterator$filenames
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 2.3.0
PHPUnit_Framework_TestSuite::addTestMethod ( ReflectionClass  $class,
ReflectionMethod  $method 
)
protected
Parameters
ReflectionClass$class
ReflectionMethod$method
PHPUnit_Framework_TestSuite::addTestSuite (   $testClass)

Adds the tests from the given class to the suite.

Parameters
mixed$testClass
Exceptions
PHPUnit_Framework_Exception
PHPUnit_Framework_TestSuite::count (   $preferCache = false)

Counts the number of test cases that will be run by this test.

Parameters
bool$preferCacheIndicates if cache is preferred.
Returns
int
PHPUnit_Framework_TestSuite::createResult ( )
protected

Creates a default TestResult object.

Returns
PHPUnit_Framework_TestResult
static PHPUnit_Framework_TestSuite::createTest ( ReflectionClass  $theClass,
  $name 
)
static
Parameters
ReflectionClass$theClass
string$name
Returns
PHPUnit_Framework_Test
Exceptions
PHPUnit_Framework_Exception
PHPUnit_Framework_TestSuite::getGroups ( )

Returns the test groups of the suite.

Returns
array
Since
Method available since Release 3.2.0
PHPUnit_Framework_TestSuite::getIterator ( )

Returns an iterator for this test suite.

Returns
RecursiveIteratorIterator
Since
Method available since Release 3.1.0

Implements IteratorAggregate.

PHPUnit_Framework_TestSuite::getName ( )

Returns the name of the suite.

Returns
string
static PHPUnit_Framework_TestSuite::incompleteTest (   $class,
  $methodName,
  $message 
)
staticprotected
Parameters
string$class
string$methodName
string$message
Returns
PHPUnit_Framework_IncompleteTestCase
Since
Method available since Release 4.3.0
static PHPUnit_Framework_TestSuite::isTestMethod ( ReflectionMethod  $method)
static
Parameters
ReflectionMethod$method
Returns
bool
PHPUnit_Framework_TestSuite::markTestSuiteSkipped (   $message = '')

Mark the test suite as skipped.

Parameters
string$message
Exceptions
PHPUnit_Framework_SkippedTestSuiteError
Since
Method available since Release 3.0.0
PHPUnit_Framework_TestSuite::run ( PHPUnit_Framework_TestResult  $result = null)

Runs the tests and collects their result in a TestResult.

Parameters
PHPUnit_Framework_TestResult$result
Returns
PHPUnit_Framework_TestResult

Implements PHPUnit_Framework_Test.

PHPUnit_Framework_TestSuite::runTest ( PHPUnit_Framework_Test  $test,
PHPUnit_Framework_TestResult  $result 
)
PHPUnit_Framework_TestSuite::setBackupGlobals (   $backupGlobals)
Parameters
bool$backupGlobals
Since
Method available since Release 3.3.0
PHPUnit_Framework_TestSuite::setBackupStaticAttributes (   $backupStaticAttributes)
Parameters
bool$backupStaticAttributes
Since
Method available since Release 3.4.0
PHPUnit_Framework_TestSuite::setDisallowChangesToGlobalState (   $disallowChangesToGlobalState)
Parameters
bool$disallowChangesToGlobalState
Since
Method available since Release 4.6.0
PHPUnit_Framework_TestSuite::setGroupDetails ( array  $groups)

Set tests groups of the test case

Parameters
array$groups
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestSuite::setName (   $name)

Sets the name of the suite.

Parameters
string
PHPUnit_Framework_TestSuite::setRunTestInSeparateProcess (   $runTestInSeparateProcess)
Parameters
bool$runTestInSeparateProcess
Exceptions
PHPUnit_Framework_Exception
Since
Method available since Release 3.7.0
PHPUnit_Framework_TestSuite::setTests ( array  $tests)

Set tests of the test suite

Parameters
array$tests
Since
Method available since Release 4.0.0
PHPUnit_Framework_TestSuite::setUp ( )
protected

Template Method that is called before the tests of this test suite are run.

Since
Method available since Release 3.1.0
static PHPUnit_Framework_TestSuite::skipTest (   $class,
  $methodName,
  $message 
)
staticprotected
Parameters
string$class
string$methodName
string$message
Returns
PHPUnit_Framework_SkippedTestCase
Since
Method available since Release 4.3.0
PHPUnit_Framework_TestSuite::tearDown ( )
protected

Template Method that is called after the tests of this test suite have finished running.

Since
Method available since Release 3.1.0
PHPUnit_Framework_TestSuite::testAt (   $index)

Returns the test at the given index.

Parameters
int
Returns
PHPUnit_Framework_Test
PHPUnit_Framework_TestSuite::tests ( )

Returns the tests as an enumeration.

Returns
array
PHPUnit_Framework_TestSuite::toString ( )

Returns a string representation of the test suite.

Returns
string

Implements PHPUnit_Framework_SelfDescribing.

static PHPUnit_Framework_TestSuite::warning (   $message)
staticprotected
Parameters
string$message
Returns
PHPUnit_Framework_Warning

The documentation for this class was generated from the following file: