Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 744 Bytes

set-default-test-suite.md

File metadata and controls

28 lines (20 loc) · 744 Bytes

Set default test suite in PHPUnit

To set a default test suite in PHPUnit, add the defaultTestSuite attribute to the phpunit tag in the phpunit.xml file. Be sure its value corresponds to a test suite later in the file.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit
        defaultTestSuite="unit"
 >
    <testsuites>
        <testsuite name="unit">
            <directory suffix="Test.php">tests/Unit</directory>
        </testsuite>
    </testsuites>
</phpunit>

Now, to run the default test suite, just run phpunit without arguments:

phpunit

See the this Stack Overflow discussion for discussion.