The forceCoversAnnotation Attribute

The printerClass Attribute

Default: PHPUnit\TextUI\ResultPrinter

This attribute configures the name of a class that either is PHPUnit\TextUI\ResultPrinter or that extends PHPUnit\TextUI\ResultPrinter. An object of this class is used to print progress and test results.

The printerFile Attribute

This attribute can be used to configure the path to the sourcecode file that declares the class configured with printerClass in case that class cannot be autoloaded.

The processIsolation Attribute

Possible values: true or false (default: false)

This attribute configures whether each test should be run in a separate PHP process for increased isolation.

The stopOnError Attribute

Possible values: true or false (default: false)

This attribute configures whether the test suite execution should be stopped after the first test finished with status “error”.

The stopOnFailure Attribute

Possible values: true or false (default: false)

This attribute configures whether the test suite execution should be stopped after the first test finished with status “failure”.

The stopOnIncomplete Attribute

Possible values: true or false (default: false)

This attribute configures whether the test suite execution should be stopped after the first test finished with status “incomplete”.

The stopOnRisky Attribute

Possible values: true or false (default: false)

This attribute configures whether the test suite execution should be stopped after the first test finished with status “risky”.

The stopOnSkipped Attribute

Possible values: true or false (default: false)

This attribute configures whether the test suite execution should be stopped after the first test finished with status “skipped”.

The stopOnWarning Attribute

Possible values: true or false (default: false)

This attribute configures whether the test suite execution should be stopped after the first test finished with status “warning”.

The stopOnDefect Attribute

Possible values: true or false (default: false)

This attribute configures whether the test suite execution should be stopped after the first test finished with a status “error”, “failure”, “risky” or “warning”.

The failOnRisky Attribute

Possible values: true or false (default: false)

This attribute configures whether the PHPUnit test runner should exit with a shell exit code that indicates failure when all tests are successful but there are tests that were marked as risky.

The failOnWarning Attribute

Possible values: true or false (default: false)

This attribute configures whether the PHPUnit test runner should exit with a shell exit code that indicates failure when all tests are successful but there are tests that had warnings.

The beStrictAboutChangesToGlobalState Attribute

Possible values: true or false (default: false)

This attribute configures whether PHPUnit should mark a test as risky when global state is manipulated by the code under test (or the test code).

The beStrictAboutOutputDuringTests Attribute

Possible values: true or false (default: false)

This attribute configures whether PHPUnit should mark a test as risky when the code under test (or the test code) prints output.

The beStrictAboutResourceUsageDuringSmallTests Attribute

Possible values: true or false (default: false)

This attribute configures whether PHPUnit should mark a test that is annotated with @small as risky when it invokes a PHP built-in function or method that operates on resource variables.

The beStrictAboutTestsThatDoNotTestAnything Attribute

Possible values: true or false (default: true)

This attribute configures whether PHPUnit should mark a test as risky when no assertions are performed (expectations are also considered).

The beStrictAboutTodoAnnotatedTests Attribute

Possible values: true or false (default: false)

This attribute configures whether PHPUnit should mark a test as risky when it is annotated with @todo.

The beStrictAboutCoversAnnotation Attribute

Possible values: true or false (default: false)

This attribute configures whether PHPUnit should mark a test as risky when it executes code that is not specified using @covers or @uses.

The ignoreDeprecatedCodeUnitsFromCodeCoverage Attribute

Possible values: true or false (default: false)

This attribute configures whether code units annotated with @deprecated should be ignored from code covreage.

The enforceTimeLimit Attribute

Possible values: true or false (default: false)

This attribute configures whether time limits should be enforced.

The defaultTimeLimit Attribute

Possible values: integer (default: 0)

This attribute configures the default time limit (in seconds).

The timeoutForSmallTests Attribute

Possible values: integer (default: 1)

This attribute configures the time limit for tests annotated with @small (in seconds).

The timeoutForMediumTests Attribute

Possible values: integer (default: 10)

This attribute configures the time limit for tests annotated with @medium (in seconds).

The timeoutForLargeTests Attribute

Possible values: integer (default: 60)

This attribute configures the time limit for tests annotated with @large (in seconds).

The testSuiteLoaderClass Attribute

Default: PHPUnit\Runner\StandardTestSuiteLoader

This attribute configures the name of a class that implements the PHPUnit\Runner\TestSuiteLoader interface. An object of this class is used to load the test suite.

The testSuiteLoaderFile Attribute

This attribute can be used to configure the path to the sourcecode file that declares the class configured with testSuiteLoaderClass in case that class cannot be autoloaded.

The defaultTestSuite Attribute

This attribute configures the name of the default test suite.

The verbose Attribute

Possible values: true or false (default: false)

This attribute configures whether more verbose output should be printed.

The stderr Attribute

Possible values: true or false (default: false)

This attribute configures whether PHPUnit should print its output to stderr instead of stdout.

The reverseDefectList Attribute

Possible values: true or false (default: false)

This attribute configures whether tests that are not successful should be printed in reverse order.

The registerMockObjectsFromTestArgumentsRecursively Attribute

Possible values: true or false (default: false)

This attribute configures whether arrays and object graphs that are passed from one test to another using the @depends annotation should be recursively scanned for mock objects.

The extensionsDirectory Attribute

When phpunit.phar is used then this attribute may be used to configure a directory from which all *.phar files will be loaded as extensions for the PHPUnit test runner.

The executionOrder Attribute

Possible values: default, defects, depends, random, reverse

Using multiple values is possible. These need to be separated by ,.

This attribute configures the order in which tests are executed.

The resolveDependencies Attribute

Possible values: true or false (default: false)

This attribute configures whether dependencies between tests (expressed using the @depends annotation) should be resolved.

The <testsuites> Element

Parent element: <phpunit>

This element is the root for one or more <testsuite> elements that are used to configure the tests that are to be executed.

The <testsuite> Element

Parent element: <testsuites>

A <testsuite> element must have a name attribute and may have one or more <directory> and/or <file> child elements that configure directories and/or files, respectively, that should be searched for tests.

Please note that the PHPUnit\Framework\TestListener interface is
deprecated and will be removed in the future. TestRunner extensions
should be used instead of test listeners.

The <extensions> Element

Parent element: <phpunit>

The <extensions> element and its <extension> children can be used to register test runner extensions.

The <extension> Element

Parent element: <extensions>

<extensions><extensionclass="Vendor\MyExtension"/></extensions>

The <arguments> Element

Parent element: <extension>

The <arguments> element can be used to configure a single <extension>.

Accepts a list of elements of types, which are then used to configure individual
extensions. The arguments are passed to the extension class’ __constructor
method in the order they are defined in the configuration.