In PHPUnit's help it displays the following:
--group ... Only runs tests from the specified group(s).
--exclude-group ... Exclude tests from the specified group(s).
Easy enough for one group. This works:
phpunit --group fast
Now, I can't quite figure out how to do this with more than one group. The following is not working for me:
phpunit --group fast unit # It believes you want to test unit.php
phpunit --group fast, unit # It believes you want to test unit.php
phpunit --group "fast unit" # It looks for a single group "fast unit"
phpunit --groups fast, unit # There is no option, groups
phpunit --group fast --group unit # Only one is honored
Any thoughts on the correct syntax would be welcome. Thank you.
PHPUnit is a unit testing framework for the PHP programming language. It is an instance of the xUnit design for unit testing systems that began with SUnit and became popular with JUnit. Even a small software development project usually takes hours of hard work.
The <testsuite> Element.
PHPUnit is a framework independent library for unit testing PHP. Unit testing is a method by which small units of code are tested against expected results. Traditional testing tests an app as a whole meaning that individual components rarely get tested alone.
Stub. Stubs are used with query like methods - methods that return things, but it's not important if they're actually called. $stub = $this->createMock(SomeClass::class); $stub->method('getSomething') ->willReturn('foo'); $sut->action($stub);
Use comma separation without any whitespace. E.g.
phpunit --group fast,unit
Try phpunit --group "fast, unit"
or phpunit --group fast,unit
.
Command-line parameters are split on space, so you have to either wrap the value in double quotes or omit spaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With