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 use PHPUnit assert to check an array?
- How to stop PHPUnit on failure?
- How to run all PHPUnit tests?
- How to mock a method with PHPUnit?
- What are PHPUnit required extensions
- How to assert that key exists in an array using PHPUnit?
- How to configure PHPUnit?
- How to run PHPUnit in quiet mode?
See more codes...