Lggr
Static Public Member Functions | Public Attributes | List of all members
PHPUnit\Util\Test Class Reference
Collaboration diagram for PHPUnit\Util\Test:
Collaboration graph
[legend]

Static Public Member Functions

static describe (\PHPUnit\Framework\Test $test, $asString=true)
 
static getLinesToBeCovered ($className, $methodName)
 
static getLinesToBeUsed ($className, $methodName)
 
static getRequirements ($className, $methodName)
 
static getMissingRequirements ($className, $methodName)
 
static getExpectedException ($className, $methodName)
 
static getProvidedData ($className, $methodName)
 
static getDataFromTestWithAnnotation ($docComment)
 
static parseTestMethodAnnotations ($className, $methodName='')
 
static getInlineAnnotations ($className, $methodName)
 
static getBackupSettings ($className, $methodName)
 
static getDependencies ($className, $methodName)
 
static getErrorHandlerSettings ($className, $methodName)
 
static getGroups ($className, $methodName='')
 
static getSize ($className, $methodName)
 
static getProcessIsolationSettings ($className, $methodName)
 
static getClassProcessIsolationSettings ($className, $methodName)
 
static getPreserveGlobalStateSettings ($className, $methodName)
 
static getHookMethods ($className)
 

Public Attributes

const REGEX_DATA_PROVIDER = '/@dataProvider\s+([a-zA-Z0-9._:-\\\\x7f-\xff]+)/'
 
const REGEX_TEST_WITH = '/@testWith\s+/'
 
const REGEX_EXPECTED_EXCEPTION = '(@expectedException\s+([:.\w\\\\x7f-\xff]+)(?:[\t ]+(\S*))?(?:[\t ]+(\S*))?\s*$)m'
 
const REGEX_REQUIRES_VERSION = '/@requires\s+(?P<name>PHP(?:Unit)?)\s+(?P<operator>[<>=!]{0,2})\s*(?P<version>[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'
 
const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\s+(?P<name>PHP(?:Unit)?)\s+(?P<constraint>[\d\t -.|~^]+)[ \t]*\r?$/m'
 
const REGEX_REQUIRES_OS = '/@requires\s+(?P<name>OS(?:FAMILY)?)\s+(?P<value>.+?)[ \t]*\r?$/m'
 
const REGEX_REQUIRES = '/@requires\s+(?P<name>function|extension)\s+(?P<value>([^\s<>=!]+))\s*(?P<operator>[<>=!]{0,2})\s*(?P<version>[\d\.-]+[\d\.]?)?[ \t]*\r?$/m'
 
const UNKNOWN = -1
 
const SMALL = 0
 
const MEDIUM = 1
 
const LARGE = 2
 

Detailed Description

Test helpers.

Member Function Documentation

◆ describe()

static PHPUnit\Util\Test::describe ( \PHPUnit\Framework\Test  $test,
  $asString = true 
)
static
Parameters
\PHPUnit\Framework\Test$test
bool$asString
Returns
mixed

◆ getBackupSettings()

static PHPUnit\Util\Test::getBackupSettings (   $className,
  $methodName 
)
static

Returns the backup settings for a test.

Parameters
string$className
string$methodName
Returns
array<string, bool|null>

◆ getDataFromTestWithAnnotation()

static PHPUnit\Util\Test::getDataFromTestWithAnnotation (   $docComment)
static
Parameters
string$docCommentfull docComment string
Returns
array|null array when @testWith annotation is defined, null when @testWith annotation is omitted
Exceptions
Exceptionwhen @testWith annotation is defined but cannot be parsed

◆ getDependencies()

static PHPUnit\Util\Test::getDependencies (   $className,
  $methodName 
)
static

Returns the dependencies for a test class or method.

Parameters
string$className
string$methodName
Returns
array

◆ getErrorHandlerSettings()

static PHPUnit\Util\Test::getErrorHandlerSettings (   $className,
  $methodName 
)
static

Returns the error handler settings for a test.

Parameters
string$className
string$methodName
Returns
?bool

◆ getExpectedException()

static PHPUnit\Util\Test::getExpectedException (   $className,
  $methodName 
)
static

Returns the expected exception for a test.

Parameters
string$className
string$methodName
Returns
array|false

◆ getGroups()

static PHPUnit\Util\Test::getGroups (   $className,
  $methodName = '' 
)
static

Returns the groups for a test class or method.

Parameters
string$className
string$methodName
Returns
array

◆ getHookMethods()

static PHPUnit\Util\Test::getHookMethods (   $className)
static
Parameters
string$className
Returns
array

◆ getInlineAnnotations()

static PHPUnit\Util\Test::getInlineAnnotations (   $className,
  $methodName 
)
static
Parameters
string$className
string$methodName
Returns
array

◆ getLinesToBeCovered()

static PHPUnit\Util\Test::getLinesToBeCovered (   $className,
  $methodName 
)
static
Parameters
string$className
string$methodName
Returns
array|bool
Exceptions
CodeCoverageException

◆ getLinesToBeUsed()

static PHPUnit\Util\Test::getLinesToBeUsed (   $className,
  $methodName 
)
static

Returns lines of code specified with the @uses annotation.

Parameters
string$className
string$methodName
Returns
array

◆ getMissingRequirements()

static PHPUnit\Util\Test::getMissingRequirements (   $className,
  $methodName 
)
static

Returns the missing requirements for a test.

Parameters
string$className
string$methodName
Returns
string[]

◆ getPreserveGlobalStateSettings()

static PHPUnit\Util\Test::getPreserveGlobalStateSettings (   $className,
  $methodName 
)
static

Returns the preserve global state settings for a test.

Parameters
string$className
string$methodName
Returns
?bool

◆ getProcessIsolationSettings()

static PHPUnit\Util\Test::getProcessIsolationSettings (   $className,
  $methodName 
)
static

Returns the process isolation settings for a test.

Parameters
string$className
string$methodName
Returns
bool

◆ getProvidedData()

static PHPUnit\Util\Test::getProvidedData (   $className,
  $methodName 
)
static

Returns the provided data for a method.

Parameters
string$className
string$methodName
Returns
array When a data provider is specified and exists null When no data provider is specified
Exceptions
Exception

◆ getRequirements()

static PHPUnit\Util\Test::getRequirements (   $className,
  $methodName 
)
static

Returns the requirements for a test.

Parameters
string$className
string$methodName
Returns
array

◆ getSize()

static PHPUnit\Util\Test::getSize (   $className,
  $methodName 
)
static

Returns the size of the test.

Parameters
string$className
string$methodName
Returns
int

◆ parseTestMethodAnnotations()

static PHPUnit\Util\Test::parseTestMethodAnnotations (   $className,
  $methodName = '' 
)
static
Parameters
string$className
string$methodName
Returns
array
Exceptions
ReflectionException

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