Testing multiple classes with PHPUnit

This might be a dumb question, but I can't get it to work.

I am using PHPUnit for testing. I currently have two classes in the Tests.php file:

class XTest extends PHPUnit_Framework_TestCase {...}
class YTest extends PHPUnit_Framework_TestCase {...}

However, I cannot run both classes. I run the following command on Windows:

php "C:\Program Files (x86)\PHP\phpunit" Tests

And he is trying to run a test class called "Tests". Instead, I would like it to run "XTest" and "YTest" and everything in the file. How can I easily run multiple test classes?

+5
source share
2 answers

The PHPUnit docs explain the arguments that a pending command line run expect.

Tests, , PHPUnit Tests Tests.php.

, - , TestClassName.php.

, - , , , :

php "C:\Program Files (x86)\PHP\phpunit" XTest Tests.php
php "C:\Program Files (x86)\PHP\phpunit" YTest Tests.php
+3

PHPUnit , , @group , .

, php "C:\Program Files (x86)\PHP\phpunit" --group <insert_name_of_group_to_which_xtests_and_ytests_belong>, PHPUnit , @group insert_name_of_group_to_which_xtests_and_ytests_belong PHPDoc.

+5

All Articles