PHPackages                             raffaelecarelle/phpunit-hub - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. raffaelecarelle/phpunit-hub

ActiveProject[Testing &amp; Quality](/categories/testing)

raffaelecarelle/phpunit-hub
===========================

A modern web UI for running and analyzing PHPUnit tests.

1.0.2(5mo ago)227[1 PRs](https://github.com/raffaelecarelle/phpunit-hub/pulls)MITPHPPHP &gt;=8.2CI passing

Since Nov 28Pushed 2mo agoCompare

[ Source](https://github.com/raffaelecarelle/phpunit-hub)[ Packagist](https://packagist.org/packages/raffaelecarelle/phpunit-hub)[ RSS](/packages/raffaelecarelle-phpunit-hub/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (10)Versions (12)Used By (0)

PHPUnit Hub
===========

[](#phpunit-hub)

[![PHP Version](https://camo.githubusercontent.com/744f8821cc27dec8b0013ade48179731a44eadf4f943e0b1d9ffcb93f80177de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d626c75652e737667)](https://camo.githubusercontent.com/744f8821cc27dec8b0013ade48179731a44eadf4f943e0b1d9ffcb93f80177de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d626c75652e737667)[![License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)

PHPUnit Hub is a modern, real-time web interface for running and analyzing PHPUnit tests. It provides a local, self-contained server that discovers your tests, runs them, and displays the results in a clean and interactive web UI.

The entire application is powered by a PHP backend using the high-performance [ReactPHP](https://reactphp.org/) event-loop, with a frontend built on [Vue.js](https://vuejs.org/) and [Tailwind CSS](https://tailwindcss.com/).

See [screenshots](screenshots)

Features
--------

[](#features)

- **Real-Time Feedback**: Watch your tests run in real-time via WebSockets. Test results appear immediately as each test completes, providing instant feedback during long test runs.
- **Event-Based Architecture**: Uses a custom PHPUnit extension that streams test events in real-time, eliminating the need for post-processing or file parsing.
- **Test Explorer**: The test list on the left is automatically populated by running `phpunit --list-tests`. You can click on a specific test to run it.
- **Interactive Filtering**:
    - **Test Suite**: The available test suites are automatically populated by running `phpunit --list-suites`.
    - **Group**: The available groups are automatically populated by running `phpunit --list-groups`. You can select multiple groups to run.
    - **Filter**: You can write your own filter pattern.
- **Automatic Test Re-run**: Automatically re-run your tests on file changes with the efficient `--watch` mode.
- **Live Results Display**: The "Results" tab populates progressively as tests execute:
    - **Execution Summary**: A top-level summary shows total tests, assertions, and duration (updated in real-time).
    - **Status Breakdown**: Get immediate counts for passed, failed, errors, skipped, warnings, and deprecations.
    - **Grouped by TestCase**: Tests are grouped by their parent TestCase for clarity.
    - **Prioritized Issues**: Tests with failures, errors, or other issues are displayed first. You can expand them to see detailed stack traces.
    - **Clean UI**: Passed tests are collapsed into a single summary line per group, reducing noise.
- **Modern UI**: A clean, responsive interface built with Vue.js and Tailwind CSS.
- **Self-Contained**: Runs with a simple command, no need for a separate web server like Nginx or Apache.

Installation
------------

[](#installation)

PHPUnit Hub is designed to be included as a development dependency in your PHP project.

1. **Require with Composer**: Navigate to your project's root directory and run:

    ```
    composer require --dev raffaelecarelle/phpunit-hub
    ```
2. **Configure PHPUnit**: PHPUnit Hub requires a `phpunit.xml` or `phpunit.xml.dist` file in your project's root directory. If you don't have one yet, create it:

    ```

                tests

    ```
3. **Enable Real-Time Event Streaming**: For the best experience with live test results, add the PHPUnit Hub extension to your `phpunit.xml` or `phpunit.xml.dist`:

    ```

    ```

    **What does this extension do?**

    - Streams test events (test started, passed, failed, etc.) in real-time via STDERR
    - Enables progressive result updates in the UI as tests execute
    - No temporary files or post-processing required
    - Zero impact on test execution performance

    **Note**: Without the extension, PHPUnit Hub will still work, but results will only appear after all tests complete.

That's it! All dependencies will be installed automatically.

Usage
-----

[](#usage)

1. **Start the Server**: From your project's root directory, run the `serve` command:

    ```
    vendor/bin/phpunit-hub
    ```

    The server will start, and you will see a confirmation message:

    ```
    Starting server on http://127.0.0.1:8080
    API endpoint available at GET /api/tests
    API endpoint available at POST /api/run
    WebSocket server listening on /ws/status
    Serving static files from 'public' directory

    ```

    **you can change the port with `--port` option and the host with `--host` option**
2. **Open the Web UI**: Open your web browser and navigate to ****.
3. **Run Your Tests**:

    - The **Test Explorer** on the left will show all the test suites and methods found in your project.
    - You can click on a specific test method to run it individually.
    - Alternatively, you can use the filters panel to select test suites, groups, or custom patterns.
    - Click the **"Run All"** button to start the test execution.
    - The **"Results"** tab will populate in real-time as tests execute, showing you immediate feedback on test status, failures, and errors.
    - Tests are grouped by their TestCase class, with failures and errors displayed prominently at the top.

### Running Tests in Parallel with ParaTeste

[](#running-tests-in-parallel-with-parateste)

PHPUnit Hub supports running tests in parallel using [ParaTest](https://github.com/paratestphp/paratest). This can significantly speed up your test execution on multi-core machines.

To use ParaTest, first install it as a development dependency:

```
composer require --dev brianium/paratest
```

Then, you can flag on UI "Run in parallel" settings

**Generating Coverage with ParaTest**:

If you want to generate code coverage reports while running tests in parallel with ParaTest, you need to configure a `cacheDirectory` in your `phpunit.xml` or `phpunit.xml.dist` file. This is crucial for ParaTest to correctly aggregate coverage data from parallel processes.

Add the `cacheDirectory` attribute to your `` tag:

```

            tests

```

### File Watching (Auto Re-run)

[](#file-watching-auto-re-run)

To automatically re-run tests whenever a source or test file changes, start the server with the `--watch` option:

```
vendor/bin/phpunit-hub --watch
```

When you save a `.php` file in your `src/` or `tests/` directories, the test suite will automatically execute again using the last applied filters.

**System Requirement for `--watch` on Linux:**

The watch mode on Linux relies on `inotify` for high-performance, event-driven file monitoring. You must have `inotify-tools` installed.

On Debian-based distributions (like Ubuntu), you can install it with:

```
sudo apt-get install -y inotify-tools
```

This ensures that file watching has a negligible impact on CPU performance, even on very large projects.

Technical Architecture
----------------------

[](#technical-architecture)

PHPUnit Hub uses a modern, event-driven architecture to provide real-time test feedback:

### Real-Time Event Streaming

[](#real-time-event-streaming)

The core of PHPUnit Hub's real-time capabilities is the `PhpUnitHubExtension` - a custom PHPUnit extension that hooks into PHPUnit's event system:

1. **PHPUnit Events**: The extension subscribes to PHPUnit's native events (test started, passed, failed, etc.)
2. **Event Streaming**: Each event is immediately serialized to JSON and written to STDERR
3. **Backend Processing**: The ReactPHP-based backend reads the event stream in real-time
4. **WebSocket Broadcasting**: Events are instantly broadcast to all connected browsers via WebSockets
5. **Progressive UI Updates**: The Vue.js frontend updates the results table as each test completes

### Key Components

[](#key-components)

- **PhpUnitHubExtension** (`src/PHPUnit/PhpUnitHubExtension.php`): PHPUnit extension that captures and streams test events
- **Router** (`src/Command/Router.php`): HTTP/WebSocket router that manages test execution and event broadcasting
- **StatusHandler** (`src/WebSocket/StatusHandler.php`): WebSocket handler for real-time communication with the frontend
- **TestRunner** (`src/TestRunner/TestRunner.php`): Spawns PHPUnit processes and captures their event streams
- **Frontend** (`public/index.html`): Vue.js SPA that displays test results in real-time

### Benefits of Event-Based Architecture

[](#benefits-of-event-based-architecture)

- **No Temporary Files**: Events stream directly from PHPUnit to the browser
- **Instant Feedback**: See test results as they happen, not after completion
- **Minimal Overhead**: Event serialization adds negligible performance impact
- **Scalable**: Handles large test suites efficiently without buffering all results

Contributing
------------

[](#contributing)

Contributions are welcome! Whether it's a bug report, a new feature, or a documentation improvement, your help is appreciated. Please follow these steps to contribute:

1. **Fork the Repository**: Create your own fork of the project on GitHub.
2. **Create a Branch**: Create a new branch for your feature or bug fix.

    ```
    git checkout -b feature/my-awesome-feature
    ```
3. **Make Your Changes**: Implement your changes and additions.
4. **Run Tests**: Ensure that the existing test suite passes with your changes.

    ```
    # Install development dependencies
    composer install

    # Run the test suite
    vendor/bin/phpunit
    ```
5. **Commit and Push**: Commit your changes with a clear message and push them to your forked repository.

    ```
    git commit -am "feat: Add my awesome feature"
    git push origin feature/my-awesome-feature
    ```
6. **Create a Pull Request**: Open a pull request from your branch to the main repository's `main` branch. Provide a clear title and description of your changes.

License
-------

[](#license)

This project is open-source software licensed under the **MIT License**. See the [LICENSE](LICENSE) file for more details.

---

Copyright (c) 2025 - Raffaele Carelle

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance80

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

7

Last Release

154d ago

Major Versions

0.0.4 → 1.0.02025-12-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/470d7f2b64c268ccd0d73d1d19da604f5049ffdc717170df28ac460d34b8a327?d=identicon)[raffaelecarelle](/maintainers/raffaelecarelle)

---

Top Contributors

[![raffaelecarelle](https://avatars.githubusercontent.com/u/15015792?v=4)](https://github.com/raffaelecarelle "raffaelecarelle (242 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")

---

Tags

phpunittestwebuirunner

###  Code Quality

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/raffaelecarelle-phpunit-hub/health.svg)

```
[![Health](https://phpackages.com/badges/raffaelecarelle-phpunit-hub/health.svg)](https://phpackages.com/packages/raffaelecarelle-phpunit-hub)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[drupal/drupal-driver

A collection of reusable Drupal drivers

6715.8M18](/packages/drupal-drupal-driver)[ta-tikoma/phpunit-architecture-test

Methods for testing application architecture

10745.9M13](/packages/ta-tikoma-phpunit-architecture-test)[php-mock/php-mock-phpunit

Mock built-in PHP functions (e.g. time()) with PHPUnit. This package relies on PHP's namespace fallback policy. No further extension is needed.

1718.2M399](/packages/php-mock-php-mock-phpunit)[playwright-php/playwright

Modern PHP library for Playwright automation: browsing, scraping, screenshots, testing, and more.

7613.0k5](/packages/playwright-php-playwright)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
