phpunitHow to use filters with PHPUnit?
Filters can be used with PHPUnit to limit the tests that are run. This is useful when you want to focus on a specific set of tests.
Example
$ phpunit --filter testName
This will run only the tests that match the given name.
Code explanation
phpunit
- This is the command used to run the tests.--filter
- This is the flag used to specify the filter.testName
- This is the name of the test to be run.
Helpful links
More of Phpunit
- How to show warnings in PHPUnit?
- How to stop PHPUnit on failure?
- How to skip a PHPUnit test?
- How to use the PHPUnit Framework TestCase?
- How to ignore a test in PHPUnit?
- How to use getMockBuilder with PHPUnit?
- How to use dependency injection in PHPUnit?
- How to generate a coverage report with PHPUnit?
- How to run all PHPUnit tests?
- How to install PHPUnit with a PHAR file?
See more codes...