2

I have seen How to run single test method with phpunit?

And I have no trouble applying a filter eg --filter=SomeTest but I want to be able to check a number of test files in one command line eg, --filter=SomeTest, SomeOtherTest but this does not work.

Is there a way I can do this from the command line?

Brad
  • 741
  • 7
  • 17
  • There are answers to this here: https://stackoverflow.com/questions/50800071/using-phpunits-filter-option-for-multiple-tests – benJ Feb 17 '20 at 09:50
  • was this pipe syntax documented anywhere on phpunit's site? – Brad Feb 20 '20 at 02:22

1 Answers1

3

This works --filter="SomeTest|SomeOtherTest"

According to documentation found here: https://phpunit.readthedocs.io/en/8.5/textui.html#command-line-options

Any regex pattern will also work. "If the pattern is not enclosed in delimiters, PHPUnit will enclose the pattern in / delimiters."

Also helped me to read about regular expressions: https://sitespect.force.com/onlinehelp/s/article/About-Regular-Expressions-1459718276

Brad
  • 741
  • 7
  • 17