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

  • SEARCH
  • Home
  • 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 8313223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:25:09+00:00 2026-06-08T20:25:09+00:00

In my application, I have the phpunit tests next to the source code. So

  • 0

In my application, I have the phpunit tests next to the source code. So in all maps next to let’s say DoSometing.class.php I have a DoSomethingTest.class.php.

I want to configure phpunit.xml to test all these *Test.class.php files.

How do I do that in phpunit.xml?

I have something like this at the moment:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit 
    backupGlobals="false"
    backupStaticAttributes="true"
    colors="true"
    convertErrorsToExceptions="true"
    convertNoticesToExceptions="true"
    convertWarningsToExceptions="true"
    processIsolation="true"
    stopOnFailure="true"
    syntaxCheck="false">
    <testsuites>
        <testsuite name="My Test Suite">
            <directory>./*Test.class.php</directory>
        </testsuite>
    </testsuites>
    <groups />
    <filter />
    <logging />
    <listeners />
</phpunit>
  • 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-06-08T20:25:11+00:00Added an answer on June 8, 2026 at 8:25 pm

    We use a similar structure, only our test files end with the extension .TEST, or .QTEST, .JTEST based on the testing framework since we have JavaScript and other embedded code as well that needs testing. As such, we use the suffix option on the directory node as shown below.

    <phpunit>
    <testsuites>
        <testsuite name="Your Test Suite Name">
                <directory suffix=".test">.</directory>
        </testsuite>
    </testsuites>
    </phpunit>
    

    For the PHP Unit tests (*.TEST) we use the following PHPUNIT.xml (this is edited for size)

    <!-- PHPUnit Core Settings -->
    <phpunit backupStaticAttributes="false"
         bootstrap="PeriScope-Bootstrap.php"
                 ...
    
        <testsuites>
            <testsuite name="ICAP User Interface Library">
                <directory suffix=".test">lib/.</directory>
            </testsuite>
            <testsuite name="Enterprise Scale Manager">
                <directory suffix=".test">ESM/.</directory>
            </testsuite>
            ...
        </testsuites>
    
    <!-- Add files not covered with tests into Code Coverage Analysis -->
        <filter>
            <whitelist addUncoveredFilesFromWhitelist="true">
                <directory suffix=".class">lib/.</directory>
                <directory suffix=".fn">lib/.</directory>
                <directory suffix=".php">lib/.</directory>
                ...
    
                <exclude>
                    <directory>ExternalLibraries</directory>
                </exclude>
            </whitelist>
        </filter>
    
        <logging>
            ...
        </logging>
    </phpunit>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my console application have an abstract Factory class Listener which contains code for
I have a test suite for phpunit for my symfony application. In that test
I'm using PHPUnit (3.6.7) to test and provide code coverage reports on my application,
In my Facebook application, I have one Facebook wrapper class to encapsulates some call
I have to build an application using Maven for PHP that has multiple modules.
I'm starting work with PHPUnit with Kohana. My application have many controllers which simply
I'm getting started unit testing my PHP application with PHPUnit. I understand that it's
I am using ZeroMQ socket library in my web application. I have configured php.ini
I have a php project with unit tests included. I use Netbeans for development
I have PHP application that contain three small applications. Each application have own users

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.