file-fetcher
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PHPUnit\Framework\TestSuite Class Reference
Inheritance diagram for PHPUnit\Framework\TestSuite:
PHPUnit\Framework\SelfDescribing PHPUnit\Framework\Test PHPUnit\Framework\DataProviderTestSuite

Public Member Functions

 __construct ($theClass='', string $name='')
 
 toString ()
 
 addTest (Test $test, $groups=[])
 
 addTestSuite ($testClass)
 
 addTestFile (string $filename)
 
 addTestFiles (iterable $fileNames)
 
 count (bool $preferCache=false)
 
 getName ()
 
 getGroups ()
 
 getGroupDetails ()
 
 setGroupDetails (array $groups)
 
 run (TestResult $result=null)
 
 setRunTestInSeparateProcess (bool $runTestInSeparateProcess)
 
 setName (string $name)
 
 testAt (int $index)
 
 tests ()
 
 setTests (array $tests)
 
 markTestSuiteSkipped ($message='')
 
 setBeStrictAboutChangesToGlobalState ($beStrictAboutChangesToGlobalState)
 
 setBackupGlobals ($backupGlobals)
 
 setBackupStaticAttributes ($backupStaticAttributes)
 
 getIterator ()
 
 injectFilter (Factory $filter)
 

Protected Member Functions

 createResult ()
 
 addTestMethod (\ReflectionClass $class, \ReflectionMethod $method)
 

Protected Attributes

 $backupGlobals
 
 $backupStaticAttributes
 
 $runTestInSeparateProcess = false
 
 $name = ''
 
 $groups = []
 
 $tests = []
 
 $numTests = -1
 
 $testCase = false
 
 $foundClasses = []
 

Constructor & Destructor Documentation

◆ __construct()

PHPUnit\Framework\TestSuite::__construct (   $theClass = '',
string  $name = '' 
)

Constructs a new TestSuite:

  • PHPUnit\Framework\TestSuite() constructs an empty TestSuite.
  • PHPUnit\Framework\TestSuite(ReflectionClass) constructs a TestSuite from the given class.
  • PHPUnit\Framework\TestSuite(ReflectionClass, String) constructs a TestSuite from the given class with the given name.
  • PHPUnit\Framework\TestSuite(String) either constructs a TestSuite from the given class (if the passed string is the name of an existing class) or constructs an empty TestSuite with the given name.
Parameters
\ReflectionClass | string$theClass
Exceptions
Exception

Member Function Documentation

◆ addTest()

PHPUnit\Framework\TestSuite::addTest ( Test  $test,
  $groups = [] 
)

Adds a test to the suite.

Parameters
array$groups

◆ addTestFile()

PHPUnit\Framework\TestSuite::addTestFile ( string  $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\WarningTestCase will be created instead, leaving the current test run untouched.

Exceptions
Exception

◆ addTestFiles()

PHPUnit\Framework\TestSuite::addTestFiles ( iterable  $fileNames)

Wrapper for addTestFile() that adds multiple test files.

Exceptions
Exception

◆ addTestMethod()

PHPUnit\Framework\TestSuite::addTestMethod ( \ReflectionClass  $class,
\ReflectionMethod  $method 
)
protected
Exceptions
Exception

◆ addTestSuite()

PHPUnit\Framework\TestSuite::addTestSuite (   $testClass)

Adds the tests from the given class to the suite.

Parameters
object | string$testClass
Exceptions
Exception

◆ count()

PHPUnit\Framework\TestSuite::count ( bool  $preferCache = false)

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

◆ createResult()

PHPUnit\Framework\TestSuite::createResult ( )
protected

Creates a default TestResult object.

◆ getGroupDetails()

PHPUnit\Framework\TestSuite::getGroupDetails ( )

◆ getGroups()

PHPUnit\Framework\TestSuite::getGroups ( )

Returns the test groups of the suite.

◆ getIterator()

PHPUnit\Framework\TestSuite::getIterator ( )

Returns an iterator for this test suite.

◆ getName()

PHPUnit\Framework\TestSuite::getName ( )

Returns the name of the suite.

◆ injectFilter()

PHPUnit\Framework\TestSuite::injectFilter ( Factory  $filter)

◆ markTestSuiteSkipped()

PHPUnit\Framework\TestSuite::markTestSuiteSkipped (   $message = '')

Mark the test suite as skipped.

Parameters
string$message
Exceptions
SkippedTestSuiteError@psalm-return never-return

◆ run()

PHPUnit\Framework\TestSuite::run ( TestResult  $result = null)

Runs the tests and collects their result in a TestResult.

Exceptions

@psalm-var class-string $className

Implements PHPUnit\Framework\Test.

◆ setBackupGlobals()

PHPUnit\Framework\TestSuite::setBackupGlobals (   $backupGlobals)
Parameters
bool$backupGlobals

◆ setBackupStaticAttributes()

PHPUnit\Framework\TestSuite::setBackupStaticAttributes (   $backupStaticAttributes)
Parameters
bool$backupStaticAttributes

◆ setBeStrictAboutChangesToGlobalState()

PHPUnit\Framework\TestSuite::setBeStrictAboutChangesToGlobalState (   $beStrictAboutChangesToGlobalState)
Parameters
bool$beStrictAboutChangesToGlobalState

◆ setGroupDetails()

PHPUnit\Framework\TestSuite::setGroupDetails ( array  $groups)

Set tests groups of the test case

◆ setName()

PHPUnit\Framework\TestSuite::setName ( string  $name)

◆ setRunTestInSeparateProcess()

PHPUnit\Framework\TestSuite::setRunTestInSeparateProcess ( bool  $runTestInSeparateProcess)

◆ setTests()

PHPUnit\Framework\TestSuite::setTests ( array  $tests)

Set tests of the test suite

Parameters
Test[]$tests

◆ testAt()

PHPUnit\Framework\TestSuite::testAt ( int  $index)

Returns the test at the given index.

Returns
false|Test

◆ tests()

PHPUnit\Framework\TestSuite::tests ( )

Returns the tests as an enumeration.

Returns
Test[]

◆ toString()

PHPUnit\Framework\TestSuite::toString ( )

Returns a string representation of the test suite.

Implements PHPUnit\Framework\SelfDescribing.

Member Data Documentation

◆ $backupGlobals

PHPUnit\Framework\TestSuite::$backupGlobals
protected

◆ $backupStaticAttributes

PHPUnit\Framework\TestSuite::$backupStaticAttributes
protected

◆ $foundClasses

PHPUnit\Framework\TestSuite::$foundClasses = []
protected

◆ $groups

PHPUnit\Framework\TestSuite::$groups = []
protected

◆ $name

PHPUnit\Framework\TestSuite::$name = ''
protected

◆ $numTests

PHPUnit\Framework\TestSuite::$numTests = -1
protected

◆ $runTestInSeparateProcess

PHPUnit\Framework\TestSuite::$runTestInSeparateProcess = false
protected

◆ $testCase

PHPUnit\Framework\TestSuite::$testCase = false
protected

◆ $tests

PHPUnit\Framework\TestSuite::$tests = []
protected

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