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 skip a PHPUnit test?
- How to show warnings in PHPUnit?
- How to stop PHPUnit on failure?
- How to mock a query builder with PHPUnit?
- How to run tests in parallel with PHPUnit?
- How to install PHPUnit with a PHAR file?
- How to order tests with PHPUnit?
- How to assert that key exists in an array using PHPUnit?
- What are PHPUnit required extensions
- How to install PHPUnit from Packagist?
See more codes...