Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 530957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:15:03+00:00 2026-05-13T09:15:03+00:00

This might be a stupid question, but I can’t seem to make it to

  • 0

This might be a stupid question, but I can’t seem to make it to work.

I’m using PHPUnit to test. Currently I have two classes in a file called Tests.php:

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

However, I’m unable to run both classes. I’m running the following command on Windows:

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

And it tries to run a test class called “Tests”. Instead, I’d like it to run “XTest” and “YTest” and all that are on the file. How could I run multiple test classes easily?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T09:15:04+00:00Added an answer on May 13, 2026 at 9:15 am

    The PHPUnit Docs explain the arguments the command line test runner expects.

    In your case, you’re providing Tests, which means PHPUnit looks for a class Tests in a file Tests.php.

    With this knowledge, it’s easy to see that the best way to organise your tests will be to write one test class per file, with the filenames equal to TestClassName.php.

    However, if for some reason you don’t want to do that, you can provide an extra argument to tell the test runner which file the test class is declared in:

    php "C:\Program Files (x86)\PHP\phpunit" XTest Tests.php
    php "C:\Program Files (x86)\PHP\phpunit" YTest Tests.php
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this might sound like a daft question but I can't seem to find a
This might be a very silly / stupid question, but, my defence is that
I have a form which uses the GET method. This might be a stupid
I know that might sound like a stupid question since it's a trivial feature
(Sorry if this sounds like a rant, but it's a real question and I'd
I cannot get this to work so I thought it might be a wise
I'm pretty new still at C# so I might be doing something stupid, but
this is a follow up to my recent question ( Code for identifying programming
What's the best way to implement a you must have JS enabled message? My
All, I'm trying to set up a system whereby emails sent to a certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.