Ginger Ginger - 2 years ago 117
PHP Question

How to use phpunit --testsuite option?

How do I use the phpunit --testsuite command?

For example, I have a testfile:


If I run phpunit, then it will run the tests in RegistrationConfirmedListenerTest.php, but it also runs all other tests in my tests folder.

I have tried using this the --testsuite option like this:

phpunit --testsuite RegistrationConfirmedListenerTest

However, nothing runs.

PHPUnit 4.8.26 by Sebastian Bergmann and contributors.

Time: 46 ms, Memory: 4.00Mb

No tests executed!

I have read the docs here but there aren't any examples to help:

Answer Source

You have to create a phpunit.xml and define your testsuites there.

    <testsuite name="youttestsuitename1">
    <testsuite name="youttestsuitename1">

More info to official documentations

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download