PHPackages                             mathieu-bour/hydra - 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. mathieu-bour/hydra

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

mathieu-bour/hydra
==================

Hydra provides a simple and clean way to test Laravel and Lumen packages against multiple versions.

0.1.10(5y ago)11.3k1MITPHPPHP ^7.1.3 || ^8.0

Since Dec 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mathieu-bour/hydra)[ Packagist](https://packagist.org/packages/mathieu-bour/hydra)[ Docs](https://github.com/mathieu-bour/hydra)[ RSS](/packages/mathieu-bour-hydra/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (10)Versions (12)Used By (1)

Hydra
=====

[](#hydra)

Simple and clean testing for Laravel and Lumen packages. Supports Laravel/Lumen 5.8.x, 6.x, 7.x and 8.x.

Stability disclaimer
--------------------

[](#stability-disclaimer)

This package is still in early development stage, and there are many bugs and planned features. Use it at your own risk.

Requirements
------------

[](#requirements)

- PHP 7.1.3 to 8.0

Acknowledgements
----------------

[](#acknowledgements)

This package what greatly inspired by the [orchestra/testbench](https://github.com/orchestral/testbench) package.

Configuration
-------------

[](#configuration)

Hydra configuration must be written at the base of your project. The recognized file names are the following:

- hydra.yaml
- hydra.yml
- hydra.json
- hydra.php
- .hydra.yaml
- .hydra.yml
- .hydra.json
- .hydra.php

### `sandbox` (defaults to `./hydra`)

[](#sandbox-defaults-to-hydra)

The hydra base directory, where the benches will be installed.

### `benches`

[](#benches)

A bench is described by a name (its key) and the framework (`laravel` or `lumen`) and the framework version constraint. For example, the following configuration:

```
benches:
  laravel-7:
    framework: laravel
    constraint: ^7.0
```

will create a bench `laravel-7` using the `laravel/laravel` framework and the SemVer constraint `^7.0`.

### `composer` (defaults to `composer`)

[](#composer-defaults-to-composer)

Since Hydra relies on the composer executable, you may want to override the composer executable.

For example:

```
composer: /user/bin/composer.phar
```

Usage
-----

[](#usage)

### Installing benches

[](#installing-benches)

To install the benches defined in the configuration file, run:

```
vendor/bin/hydra install
```

You may use the `--only [bench]` to install only a single bench (during matrix pipelines).

### Cleaning benches

[](#cleaning-benches)

To delete all your benches, simply run:

```
vendor/bin/hydra clean
```

### In PHPUnit tests

[](#in-phpunit-tests)

#### Setup PHPUnit

[](#setup-phpunit)

Since Hydra will basically hijack composer autoloader, you will need to replace the PHPUnit bootstrap file. During installation, Hydra generates a new bootstrap file which has to be specified in PHPUnit configuration.

For example, in a phpunit.xml file:

```

```

#### Choose the test bench

[](#choose-the-test-bench)

The test bench selection is achieved through the `HYDRA_BENCH` environment variable.

You can run phpunit like this:

```
HYDRA_BENCH=laravel-7 phpunit [args]
```

#### Use the `HydraTestCase`

[](#use-the-hydratestcase)

In order to set up tests for your package, you have to use the `Windy\Hydra\Testing\HydraTestCase` class.

##### Define a configuration:

[](#define-a-configuration)

```
use Windy\Hydra\Testing\HydraTestCase;

class ExampleTest extends HydraTestCase
{
    protected function setUpConfig(): array
    {
        return [
            'your-package' => [
                'foo' => 'bar'
            ]
        ];
    }
}
```

##### Define your providers

[](#define-your-providers)

```
use Windy\Hydra\Testing\HydraTestCase;

class ExampleTest extends HydraTestCase
{
    protected function setUpProviders(): array
    {
        return [
            \Me\MyPackage\MyPackageProvider::class
        ];
    }
}
```

##### Specific setup for Laravel and Lumen

[](#specific-setup-for-laravel-and-lumen)

If you need to run specific setup for Laravel or Lumen, you may use:

```
use Windy\Hydra\Testing\HydraTestCase;

class ExampleTest extends HydraTestCase
{
    /**
     * Set up Laravel application.
     */
    protected function setUpLaravel(): void
    {
        // Run only for Laravel applications
    }

    /**
     * Setup the Lumen application.
     */
    protected function setUpLumen(): void
    {
        // Run only for Lumen applications
    }
}
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

11

Last Release

2012d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/73c2dfce49dda5261f96316534da32fe654b5318a85049d85b651bdda2aeb167?d=identicon)[Mathieu Bour](/maintainers/Mathieu%20Bour)

---

Top Contributors

[![matbour](https://avatars.githubusercontent.com/u/21281702?v=4)](https://github.com/matbour "matbour (15 commits)")

---

Tags

laravellumentestbenchtestingtestinglaravellumenTestBench

### Embed Badge

![Health badge](/badges/mathieu-bour-hydra/health.svg)

```
[![Health](https://phpackages.com/badges/mathieu-bour-hydra/health.svg)](https://phpackages.com/packages/mathieu-bour-hydra)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k136.1M986](/packages/brianium-paratest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k42.5M40.9k](/packages/orchestra-testbench)[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k16.7M1.0k](/packages/phpro-grumphp)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)

PHPackages © 2026

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