Command Line Runner

Introduction

The Pest command line runner has many available options that can make your testing experience easier.

Available Options

Pest defers non-Pest-specific options to PHPUnit, so please refer to the PHPUnit command-line test runner documentation for a full list.

--init

This option allows you to initialise a standard Pest configuration, with the following files:

  • A tests directory.
  • A phpunit.xml configuration file.
  • A tests/Pest.php file, for configuring your testcases.
  • A tests/Helpers.php file, for configuring your helpers.
  • A tests/ExampleTest.php file, with a default example test.

--coverage

This option enables coverage using the underlying --coverage-php option, and will output the results to the terminals standard output.

You can combine this with other coverage options from PHPUnit such as --coverage-xml or --coverage-html.

--min

This option allows you to set a minimum required coverage value. If the coverage does not meet this value, the test suite will fail.

--group

This option allows you to only run a specific list of grouped tests. This is a comma-separated list.

Next section: PHPUnit →