PHP 클래스 PHPUnit_Framework_TestSuite, phpunit

파일 보기 프로젝트 열기: sebastianbergmann/phpunit 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$backupGlobals boolean Enable or disable the backup and restoration of the $GLOBALS array.
$backupStaticAttributes boolean Enable or disable the backup and restoration of static attributes.
$foundClasses array
$groups array The test groups of the test suite.
$name string The name of the test suite.
$numTests integer The number of tests in the test suite.
$runTestInSeparateProcess boolean
$testCase boolean
$tests array The tests in the test suite.

공개 메소드들

메소드 설명
__construct ( mixed $theClass = '', string $name = '' ) Constructs a new TestSuite:
addTest ( PHPUnit_Framework_Test $test, array $groups = [] ) Adds a test to the suite.
addTestFile ( string $filename ) Wraps both addTest() and addTestSuite as well as the separate import statements for the user's convenience.
addTestFiles ( array | Iterator $filenames ) Wrapper for addTestFile() that adds multiple test files.
addTestSuite ( mixed $testClass ) Adds the tests from the given class to the suite.
count ( boolean $preferCache = false ) : integer Counts the number of test cases that will be run by this test.
createTest ( ReflectionClass $theClass, string $name ) : PHPUnit_Framework_Test
getGroupDetails ( )
getGroups ( ) : array Returns the test groups of the suite.
getIterator ( ) : RecursiveIteratorIterator Returns an iterator for this test suite.
getName ( ) : string Returns the name of the suite.
injectFilter ( PHPUnit_Runner_Filter_Factory $filter )
isTestMethod ( ReflectionMethod $method ) : boolean
markTestSuiteSkipped ( string $message = '' ) Mark the test suite as skipped.
run ( PHPUnit_Framework_TestResult $result = null ) : PHPUnit_Framework_TestResult Runs the tests and collects their result in a TestResult.
runTest ( PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result ) Runs a test.
setBackupGlobals ( boolean $backupGlobals )
setBackupStaticAttributes ( boolean $backupStaticAttributes )
setGroupDetails ( array $groups ) Set tests groups of the test case
setName ( $name ) Sets the name of the suite.
setRunTestInSeparateProcess ( boolean $runTestInSeparateProcess )
setTests ( array $tests ) Set tests of the test suite
setbeStrictAboutChangesToGlobalState ( boolean $beStrictAboutChangesToGlobalState )
testAt ( $index ) : PHPUnit_Framework_Test Returns the test at the given index.
tests ( ) : array Returns the tests as an enumeration.
toString ( ) : string Returns a string representation of the test suite.

보호된 메소드들

메소드 설명
addTestMethod ( ReflectionClass $class, ReflectionMethod $method )
createResult ( ) : PHPUnit_Framework_TestResult Creates a default TestResult object.
incompleteTest ( string $class, string $methodName, string $message ) : PHPUnit_Framework_IncompleteTestCase
setUp ( ) Template Method that is called before the tests of this test suite are run.
skipTest ( string $class, string $methodName, string $message ) : PHPUnit_Framework_SkippedTestCase
tearDown ( ) Template Method that is called after the tests of this test suite have finished running.
warning ( string $message ) : PHPUnit_Framework_WarningTestCase

메소드 상세

__construct() 공개 메소드

- 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.
public __construct ( mixed $theClass = '', string $name = '' )
$theClass mixed
$name string

addTest() 공개 메소드

Adds a test to the suite.
public addTest ( PHPUnit_Framework_Test $test, array $groups = [] )
$test PHPUnit_Framework_Test
$groups array

addTestFile() 공개 메소드

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.
public addTestFile ( string $filename )
$filename string

addTestFiles() 공개 메소드

Wrapper for addTestFile() that adds multiple test files.
public addTestFiles ( array | Iterator $filenames )
$filenames array | Iterator

addTestMethod() 보호된 메소드

protected addTestMethod ( ReflectionClass $class, ReflectionMethod $method )
$class ReflectionClass
$method ReflectionMethod

addTestSuite() 공개 메소드

Adds the tests from the given class to the suite.
public addTestSuite ( mixed $testClass )
$testClass mixed

count() 공개 메소드

Counts the number of test cases that will be run by this test.
public count ( boolean $preferCache = false ) : integer
$preferCache boolean Indicates if cache is preferred.
리턴 integer

createResult() 보호된 메소드

Creates a default TestResult object.
protected createResult ( ) : PHPUnit_Framework_TestResult
리턴 PHPUnit_Framework_TestResult

createTest() 공개 정적인 메소드

public static createTest ( ReflectionClass $theClass, string $name ) : PHPUnit_Framework_Test
$theClass ReflectionClass
$name string
리턴 PHPUnit_Framework_Test

getGroupDetails() 공개 메소드

public getGroupDetails ( )

getGroups() 공개 메소드

Returns the test groups of the suite.
public getGroups ( ) : array
리턴 array

getIterator() 공개 메소드

Returns an iterator for this test suite.

getName() 공개 메소드

Returns the name of the suite.
public getName ( ) : string
리턴 string

incompleteTest() 보호된 정적인 메소드

protected static incompleteTest ( string $class, string $methodName, string $message ) : PHPUnit_Framework_IncompleteTestCase
$class string
$methodName string
$message string
리턴 PHPUnit_Framework_IncompleteTestCase

injectFilter() 공개 메소드

public injectFilter ( PHPUnit_Runner_Filter_Factory $filter )
$filter PHPUnit_Runner_Filter_Factory

isTestMethod() 공개 정적인 메소드

public static isTestMethod ( ReflectionMethod $method ) : boolean
$method ReflectionMethod
리턴 boolean

markTestSuiteSkipped() 공개 메소드

Mark the test suite as skipped.
public markTestSuiteSkipped ( string $message = '' )
$message string

run() 공개 메소드

Runs the tests and collects their result in a TestResult.
public run ( PHPUnit_Framework_TestResult $result = null ) : PHPUnit_Framework_TestResult
$result PHPUnit_Framework_TestResult
리턴 PHPUnit_Framework_TestResult

runTest() 공개 메소드

Runs a test.
사용 중단:
public runTest ( PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result )
$test PHPUnit_Framework_Test
$result PHPUnit_Framework_TestResult

setBackupGlobals() 공개 메소드

public setBackupGlobals ( boolean $backupGlobals )
$backupGlobals boolean

setBackupStaticAttributes() 공개 메소드

public setBackupStaticAttributes ( boolean $backupStaticAttributes )
$backupStaticAttributes boolean

setGroupDetails() 공개 메소드

Set tests groups of the test case
public setGroupDetails ( array $groups )
$groups array

setName() 공개 메소드

Sets the name of the suite.
public setName ( $name )

setRunTestInSeparateProcess() 공개 메소드

public setRunTestInSeparateProcess ( boolean $runTestInSeparateProcess )
$runTestInSeparateProcess boolean

setTests() 공개 메소드

Set tests of the test suite
public setTests ( array $tests )
$tests array

setUp() 보호된 메소드

Template Method that is called before the tests of this test suite are run.
protected setUp ( )

setbeStrictAboutChangesToGlobalState() 공개 메소드

public setbeStrictAboutChangesToGlobalState ( boolean $beStrictAboutChangesToGlobalState )
$beStrictAboutChangesToGlobalState boolean

skipTest() 보호된 정적인 메소드

protected static skipTest ( string $class, string $methodName, string $message ) : PHPUnit_Framework_SkippedTestCase
$class string
$methodName string
$message string
리턴 PHPUnit_Framework_SkippedTestCase

tearDown() 보호된 메소드

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

testAt() 공개 메소드

Returns the test at the given index.
public testAt ( $index ) : PHPUnit_Framework_Test
리턴 PHPUnit_Framework_Test

tests() 공개 메소드

Returns the tests as an enumeration.
public tests ( ) : array
리턴 array

toString() 공개 메소드

Returns a string representation of the test suite.
public toString ( ) : string
리턴 string

warning() 보호된 정적인 메소드

protected static warning ( string $message ) : PHPUnit_Framework_WarningTestCase
$message string
리턴 PHPUnit_Framework_WarningTestCase

프로퍼티 상세

$backupGlobals 보호되어 있는 프로퍼티

Enable or disable the backup and restoration of the $GLOBALS array.
protected bool $backupGlobals
리턴 boolean

$backupStaticAttributes 보호되어 있는 프로퍼티

Enable or disable the backup and restoration of static attributes.
protected bool $backupStaticAttributes
리턴 boolean

$foundClasses 보호되어 있는 프로퍼티

protected array $foundClasses
리턴 array

$groups 보호되어 있는 프로퍼티

The test groups of the test suite.
protected array $groups
리턴 array

$name 보호되어 있는 프로퍼티

The name of the test suite.
protected string $name
리턴 string

$numTests 보호되어 있는 프로퍼티

The number of tests in the test suite.
protected int $numTests
리턴 integer

$runTestInSeparateProcess 보호되어 있는 프로퍼티

protected bool $runTestInSeparateProcess
리턴 boolean

$testCase 보호되어 있는 프로퍼티

protected bool $testCase
리턴 boolean

$tests 보호되어 있는 프로퍼티

The tests in the test suite.
protected array $tests
리턴 array