Download the PHP package giorgiosironi/eris without Composer
On this page you can find all versions of the php package giorgiosironi/eris. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download giorgiosironi/eris
More information about giorgiosironi/eris
Files in giorgiosironi/eris
Package eris
Short Description PHP library for property-based testing. Integrates with PHPUnit.
License MIT
Informations about the package eris
Eris
Eris is a porting of QuickCheck and property-based testing tools to the PHP and PHPUnit ecosystem.
In property-based testing, several properties that the System Under Test must respect are defined, and a large sample of generated inputs is sent to it in an attempt to break the properties.
Compatibility
- PHP 7.4, 8.0, 8.1, 8.2
- PHPUnit 8.x, 9.x
Installation
You can install Eris through Composer by running the following command in your terminal:
You can run some of Eris example tests with vendor/bin/phpunit vendor/giorgiosironi/eris/examples
.
Here is an empty sample project installing Eris.
Please note the project is in alpha stage and the API may change at any time.
Example usage within PHPUnit
This test tries to verify that natural numbers from 0 to 1000 are all smaller than 42. It's a failing test designed to show you an example of error message.
Eris generates a sample of elements from the required domain (here the integers from 0 to 1000) and verifies a property on each of them, stopping at the first failure.
Eris also tries to shrink the input after a failure, giving you the simplest input that still fails the test. In this example, the original input was probably something like 562
, but Eris tries to make it smaller until the test became green again. The smallest value that still fails the test is the one presented to you.
Documentation
On ReadTheDocs you can find the reference documentation for the Eris project.
Changelog
Consult the Changelog file to know the latest new features.
Support and contributing
Feel free to open issues on the GitHub project for support and feature requests.
Pull requests are welcome. For anything longer than a few lines it's worth to open an issue first to get feedback on the intended solution and whether it will integrate well with the rest of the codebase.
If you contribute a commit to Eris, you will be credited in the contributors file (unless you don't want to.)