LinuxCommandLibrary

phpunit

TLDR

Run all tests

$ phpunit
copy
Run specific test file
$ phpunit [tests/ExampleTest.php]
copy
Run tests in directory
$ phpunit [tests/]
copy
Run specific test
$ phpunit --filter [testMethodName]
copy
Generate coverage report
$ phpunit --coverage-html [coverage/]
copy
Use configuration
$ phpunit -c [phpunit.xml]
copy

SYNOPSIS

phpunit [options] [files...]

DESCRIPTION

phpunit is PHP testing framework. Unit and integration testing.
The tool provides assertions and mocks. Standard PHP testing tool.
phpunit runs PHP tests.

PARAMETERS

FILES

Test files or directories.
--filter PATTERN
Filter tests.
--coverage-html DIR
HTML coverage report.
-c FILE
Configuration file.
--testdox
TestDox output.
--help
Display help.

CAVEATS

Configuration via phpunit.xml. Coverage needs Xdebug/PCOV.

HISTORY

PHPUnit was created by Sebastian Bergmann as the standard PHP testing framework.

SEE ALSO

phpspec(1), pest(1), php(1)

Copied to clipboard