2017 © Pedro Peláez
 

library eris

PHP library for property-based testing. Integrates with PHPUnit.

image

giorgiosironi/eris

PHP library for property-based testing. Integrates with PHPUnit.

  • Monday, June 4, 2018
  • by giorgiosironi
  • Repository
  • 19 Watchers
  • 252 Stars
  • 36,440 Installations
  • PHP
  • 35 Dependents
  • 0 Suggesters
  • 22 Forks
  • 8 Open issues
  • 67 Versions
  • 17 % Grown

The README.md

Eris

CI Static analysis Documentation Status License: MIT, (*1)

Eris is a porting of QuickCheck and property-based testing tools to the PHP and PHPUnit ecosystem., (*2)

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., (*3)

Compatibility

  • PHP 8.1, 8.2, 8.3, 8.4
  • PHPUnit 10.x, 11.x

Installation

You can install Eris through Composer by running the following command in your terminal:, (*4)

composer require --dev giorgiosironi/eris

You can run some of Eris example tests with vendor/bin/phpunit vendor/giorgiosironi/eris/examples., (*5)

Here is an empty sample project installing Eris., (*6)

Please note the project is in alpha stage and the API may change at any time., (*7)

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., (*8)

<?php
use Eris\Generators;

class ReadmeTest extends \PHPUnit\Framework\TestCase
{
    use \Eris\TestTrait;

    public function testNaturalNumbersMagnitude()
    {
        $this->forAll(
            Generators::choose(0, 1000)
        )
            ->then(function($number) {
                $this->assertTrue(
                    $number < 42,
                    "$number is not less than 42 apparently"
                );
            });
    }
}

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., (*9)

[10:34:32][giorgio@Bipbip:~/code/eris]$ vendor/bin/phpunit examples/ReadmeTest.php
PHPUnit 4.3.5 by Sebastian Bergmann.

Configuration read from /home/giorgio/code/eris/phpunit.xml

F

Time: 234 ms, Memory: 3.25Mb

There was 1 failure:

1) ReadmeTest::testNaturalNumbersMagnitude
42 is not less than 42 apparently
Failed asserting that false is true.

/home/giorgio/code/eris/examples/ReadmeTest.php:15
/home/giorgio/code/eris/src/Eris/Quantifier/Evaluation.php:48
/home/giorgio/code/eris/src/Eris/Quantifier/RoundRobinShrinking.php:45
/home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:69
/home/giorgio/code/eris/src/Eris/Quantifier/Evaluation.php:50
/home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:71
/home/giorgio/code/eris/src/Eris/Quantifier/ForAll.php:87
/home/giorgio/code/eris/examples/ReadmeTest.php:16
/home/giorgio/code/eris/examples/ReadmeTest.php:16

FAILURES!
Tests: 1, Assertions: 826, Failures: 1.

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., (*10)

Documentation

On ReadTheDocs you can find the reference documentation for the Eris project., (*11)

Changelog

Consult the Changelog file to know the latest new features., (*12)

Support and contributing

Feel free to open issues on the GitHub project for support and feature requests., (*13)

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., (*14)

If you contribute a commit to Eris, you will be credited in the contributors file (unless you don't want to.), (*15)

The Versions

04/06 2018

dev-php_7.2

dev-php_7.2

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

04/06 2018

dev-master

9999999-dev

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

23/03 2018

0.10.0

0.10.0.0

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

  • php >=5.5

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

12/03 2017

0.9.0

0.9.0.0

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

03/07 2016

dev-minimum_evaluation_ratio_as_listener

dev-minimum_evaluation_ratio_as_listener

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

15/04 2016

0.8.0

0.8.0.0

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

14/04 2016

dev-listeners_failure_shrinking

dev-listeners_failure_shrinking

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

10/04 2016

dev-random_number_generator

dev-random_number_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

10/04 2016

dev-such_that_when_unification

dev-such_that_when_unification

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

23/03 2016

dev-mt_random_number

dev-mt_random_number

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

22/03 2016

dev-disable_shrinking_option

dev-disable_shrinking_option

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

11/03 2016

dev-logging

dev-logging

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

10/03 2016

dev-limit_to_date_interval

dev-limit_to_date_interval

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

04/03 2016

0.7.0

0.7.0.0

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

04/03 2016

dev-bind_generator

dev-bind_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

03/03 2016

dev-remove_support_for_array_of_generators

dev-remove_support_for_array_of_generators

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

03/03 2016

dev-associative_array

dev-associative_array

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

03/03 2016

dev-such_that_generator

dev-such_that_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

29/02 2016

dev-generated_data_distribution

dev-generated_data_distribution

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

29/02 2016

dev-generator_map

dev-generator_map

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

29/11 2015

dev-subset_generator

dev-subset_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

22/11 2015

dev-renaming_generator_classes

dev-renaming_generator_classes

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

05/11 2015

0.5.0

0.5.0.0

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

31/10 2015

dev-travis_ci_container_infrastructure

dev-travis_ci_container_infrastructure

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

31/10 2015

dev-iterations_configuration

dev-iterations_configuration

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

31/08 2015

dev-nat_pos_neg_generators

dev-nat_pos_neg_generators

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

11/08 2015

dev-using_size_to_quickcheck

dev-using_size_to_quickcheck

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

27/05 2015

0.4.0

0.4.0.0

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Gabriele Lana
by Mirko Bonadei

07/01 2015

0.3.1

0.3.1.0

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Mirko Bonadei

04/01 2015

dev-names_generator

dev-names_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Mirko Bonadei

04/01 2015

dev-byte_generator

dev-byte_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Mirko Bonadei

29/12 2014

dev-error_messages

dev-error_messages

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Mirko Bonadei

29/12 2014

dev-tuple_variadic_arguments

dev-tuple_variadic_arguments

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Mirko Bonadei

29/12 2014

dev-shrinking_with_when

dev-shrinking_with_when

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Mirko Bonadei

28/12 2014

0.3.0

0.3.0.0

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Mirko Bonadei

27/12 2014

dev-one-of-generator

dev-one-of-generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

27/12 2014

dev-for_all_variadic_arguments

dev-for_all_variadic_arguments

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

27/12 2014

dev-date_generator

dev-date_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

27/12 2014

dev-char_generator

dev-char_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Mirko Bonadei

23/12 2014

dev-badges

dev-badges

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Mirko Bonadei

23/12 2014

dev-regex_generator

dev-regex_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Giorgio Sironi
by Mirko Bonadei

23/12 2014

dev-error_message_on_generic_exception

dev-error_message_on_generic_exception

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

23/12 2014

dev-shrinking_time_limit

dev-shrinking_time_limit

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

15/12 2014

dev-list-generator

dev-list-generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

15/12 2014

dev-strict_equality_check_to_test_eris

dev-strict_equality_check_to_test_eris

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

14/12 2014

dev-fix-string-test

dev-fix-string-test

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

14/12 2014

dev-float_generator

dev-float_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

14/12 2014

dev-integer_interval

dev-integer_interval

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

14/12 2014

dev-more_robust_natural_generator

dev-more_robust_natural_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

14/12 2014

dev-integer_generator

dev-integer_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

13/12 2014

dev-natural-lower-limit

dev-natural-lower-limit

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

13/12 2014

0.2.0

0.2.0.0

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

13/12 2014

dev-refactoring_shrinking_algorithm

dev-refactoring_shrinking_algorithm

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

13/12 2014

dev-better-shrinking

dev-better-shrinking

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

12/12 2014

dev-tuple-generator

dev-tuple-generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

10/12 2014

dev-style

dev-style

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

10/12 2014

dev-alignment

dev-alignment

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

10/12 2014

dev-fix_travis

dev-fix_travis

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

10/12 2014

dev-boolean_generator

dev-boolean_generator

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

MIT

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

08/12 2014

0.1.0

0.1.0.0

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

08/12 2014

dev-supporting_seed

dev-supporting_seed

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

08/12 2014

dev-vector_end2end

dev-vector_end2end

PHP library for property-based testing. Integrates with PHPUnit.

  Sources   Download

The Requires

 

by Giorgio Sironi
by Mirko Bonadei

06/12 2014

dev-string_generator

dev-string_generator

PHP library for property-based testing.

  Sources   Download

The Requires

 

by Giorgio Sironi

05/12 2014

dev-such_that

dev-such_that

PHP library for property-based testing.

  Sources   Download

The Requires

 

by Giorgio Sironi

23/11 2014

dev-end2end_tests

dev-end2end_tests

PHP library for property-based testing.

  Sources   Download

The Requires

 

by Giorgio Sironi

19/11 2014

dev-stateless_generators

dev-stateless_generators

PHP library for property-based testing.

  Sources   Download

The Requires

 

by Giorgio Sironi

18/11 2014

dev-vector_generator

dev-vector_generator

PHP library for property-based testing.

  Sources   Download

The Requires

 

by Giorgio Sironi