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 stop PHPUnit on failure?
- How to run tests in parallel with PHPUnit?
- How to show warnings in PHPUnit?
- How to skip a PHPUnit test?
- What are PHPUnit required extensions
- How to run all PHPUnit tests?
- How to mock a method with different arguments in PHPUnit?
- How to test private methods in PHPUnit?
- How to use the PHPUnit Framework TestCase?
- How to mock a class in PHPUnit?
See more codes...