Download the PHP package raffaelecarelle/phpunit-hub without Composer

On this page you can find all versions of the php package raffaelecarelle/phpunit-hub. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpunit-hub

PHPUnit Hub

PHP Version License

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 event-loop, with a frontend built on Vue.js and Tailwind CSS.

See screenshots

Features

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:

  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:

  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

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

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

    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 http://127.0.0.1:8080.

  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

PHPUnit Hub supports running tests in parallel using ParaTest. This can significantly speed up your test execution on multi-core machines.

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

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 <phpunit> tag:

File Watching (Auto Re-run)

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

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:

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

Technical Architecture

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

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

Benefits of Event-Based Architecture

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.

  3. Make Your Changes: Implement your changes and additions.

  4. Run Tests: Ensure that the existing test suite passes with your changes.

  5. Commit and Push: Commit your changes with a clear message and push them to your forked repository.

  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

This project is open-source software licensed under the MIT License. See the LICENSE file for more details.


Copyright (c) 2025 - Raffaele Carelle


All versions of phpunit-hub with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/console Version ^6.4|^7.3
symfony/process Version ^6.4|^7.3
cboden/ratchet Version ^0.4.4
react/event-loop Version ^1.3
react/child-process Version ^0.6.1
ramsey/uuid Version ^4.7
phpunit/phpunit Version ^10.5
ext-simplexml Version *
ext-dom Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package raffaelecarelle/phpunit-hub contains the following files

Loading the files please wait ...