class Configuration (View source)

Wrapper for the PHPUnit XML configuration file.

Example XML configuration file:

/path/to/files /path/to/MyTest.php /path/to/files/exclude

name name

name name

/path/to/files /path/to/file /path/to/files /path/to/file

Sebastian 22 April 19.78 MyRelativeFile.php MyRelativeDir

.

Constants

TEST_SUITE_FILTER_SEPARATOR

Properties

protected $document
protected $xpath
protected $filename

Methods

__construct(string $filename)

Loads a PHPUnit configuration file.

static Configuration
getInstance(string $filename)

Returns a PHPUnit configuration object.

string
getFilename()

Returns the realpath to the configuration file.

array
getFilterConfiguration()

Returns the configuration for SUT filtering.

array
getGroupConfiguration()

Returns the configuration for groups.

array
getTestdoxGroupConfiguration()

Returns the configuration for testdox groups.

array
getListenerConfiguration()

Returns the configuration for listeners.

array
getLoggingConfiguration()

Returns the logging configuration.

array
getPHPConfiguration()

Returns the PHP configuration.

handlePHPConfiguration()

Handles the PHP configuration.

array
getPHPUnitConfiguration()

Returns the PHPUnit configuration.

getTestSuiteConfiguration(string|null $testSuiteFilter = null)

Returns the test suite configuration.

array
getTestSuiteNames()

Returns the test suite names from the configuration.

getTestSuite(DOMElement $testSuiteNode, string|null $testSuiteFilter = null)

No description

string|bool
getBoolean(string $value, string|bool $default)

if $value is 'false' or 'true', this returns the value that $value represents.

int
getInteger(string $value, int $default)

No description

array
readFilterDirectories(string $query)

No description

array
readFilterFiles(string $query)

No description

string
toAbsolutePath(string $path, bool $useIncludePath = false)

No description

Details

protected __construct(string $filename)

Loads a PHPUnit configuration file.

Parameters

string $filename

static Configuration getInstance(string $filename)

Returns a PHPUnit configuration object.

Parameters

string $filename

Return Value

Configuration

string getFilename()

Returns the realpath to the configuration file.

Return Value

string

array getFilterConfiguration()

Returns the configuration for SUT filtering.

Return Value

array

array getGroupConfiguration()

Returns the configuration for groups.

Return Value

array

array getTestdoxGroupConfiguration()

Returns the configuration for testdox groups.

Return Value

array

array getListenerConfiguration()

Returns the configuration for listeners.

Return Value

array

array getLoggingConfiguration()

Returns the logging configuration.

Return Value

array

array getPHPConfiguration()

Returns the PHP configuration.

Return Value

array

handlePHPConfiguration()

Handles the PHP configuration.

array getPHPUnitConfiguration()

Returns the PHPUnit configuration.

Return Value

array

TestSuite getTestSuiteConfiguration(string|null $testSuiteFilter = null)

Returns the test suite configuration.

Parameters

string|null $testSuiteFilter

Return Value

TestSuite

array getTestSuiteNames()

Returns the test suite names from the configuration.

Return Value

array

protected TestSuite getTestSuite(DOMElement $testSuiteNode, string|null $testSuiteFilter = null)

Parameters

DOMElement $testSuiteNode
string|null $testSuiteFilter

Return Value

TestSuite

protected string|bool getBoolean(string $value, string|bool $default)

if $value is 'false' or 'true', this returns the value that $value represents.

Otherwise, returns $default, which may be a string in rare cases. See PHPUnit\Util\ConfigurationTest::testPHPConfigurationIsReadCorrectly

Parameters

string $value
string|bool $default

Return Value

string|bool

protected int getInteger(string $value, int $default)

Parameters

string $value
int $default

Return Value

int

protected array readFilterDirectories(string $query)

Parameters

string $query

Return Value

array

protected array readFilterFiles(string $query)

Parameters

string $query

Return Value

array

protected string toAbsolutePath(string $path, bool $useIncludePath = false)

Parameters

string $path
bool $useIncludePath

Return Value

string