Download the PHP package mathieu-bour/hydra without Composer
On this page you can find all versions of the php package mathieu-bour/hydra. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mathieu-bour/hydra
More information about mathieu-bour/hydra
Files in mathieu-bour/hydra
Package hydra
Short Description Hydra provides a simple and clean way to test Laravel and Lumen packages against multiple versions.
License MIT
Homepage https://github.com/mathieu-bour/hydra
Informations about the package 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
This package is still in early development stage, and there are many bugs and planned features. Use it at your own risk.
Requirements
- PHP 7.1.3 to 8.0
Acknowledgements
This package what greatly inspired by the orchestra/testbench package.
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
)
The hydra base directory, where the benches will be installed.
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:
will create a bench laravel-7
using the laravel/laravel
framework and the SemVer constraint ^7.0
.
composer
(defaults to composer
)
Since Hydra relies on the composer executable, you may want to override the composer executable.
For example:
Usage
Installing benches
To install the benches defined in the configuration file, run:
You may use the --only [bench]
to install only a single bench (during matrix pipelines).
Cleaning benches
To delete all your benches, simply run:
In PHPUnit tests
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
The test bench selection is achieved through the HYDRA_BENCH
environment variable.
You can run phpunit like this:
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 your providers
Specific setup for Laravel and Lumen
If you need to run specific setup for Laravel or Lumen, you may use:
All versions of hydra with dependencies
ext-json Version *
phpcompatibility/php-compatibility Version *
phpunit/phpunit Version ^7.0 || ^8.0 || ^9.0
symfony/console Version ^4.0 || ^5.2
symfony/process Version ^4.0 || ^5.2
symfony/yaml Version ^4.0 || ^5.2