Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not run some tests in PHPUnit?

I don't want to run all the tests sometimes to save time. I know I can comment the tests. But this method isn't elegant. I'm wondering whether there is some simple way to do that.

All advice is appreciated.

Thanks for your time and best regards, Box He

like image 350
Box Avatar asked Nov 28 '22 20:11

Box


1 Answers

phpunit command line test runner has --filter argument which is a regular expression to match the executed test case names.

Suppose, you need to exclude all the test cases, names of which contain "Foo". Then, use:

--filter /^(?:(?!Foo).)*$/
like image 59
Ivan Krechetov Avatar answered Dec 06 '22 08:12

Ivan Krechetov