<?php

declare(strict_types=1);

namespace test\Primitive;

use Widmogrod\Helpful\SetoidLaws;
use Widmogrod\Primitive\Num;

class NumTest extends \PHPUnit\Framework\TestCase
{
    /**
     * @dataProvider provideSetoidLaws
     */
    public function test_it_should_obay_setoid_laws(
        $a,
        $b,
        $c
    ) {
        SetoidLaws::test(
            [$this, 'assertEquals'],
            $a,
            $b,
            $c
        );
    }

    private function randomize()
    {
        return Num::of(random_int(-100000000, 100000000));
    }

    public function provideSetoidLaws()
    {
        return array_map(function () {
            return [
                $this->randomize(),
                $this->randomize(),
                $this->randomize(),
            ];
        }, array_fill(0, 50, null));
    }
}

<?php

declare(strict_types=1);

namespace test\Primitive;

use Eris\TestTrait;
use Eris\Generator;
use Widmogrod\Helpful\SetoidLaws;
use Widmogrod\Primitive\Num;

class NumTest extends \PHPUnit\Framework\TestCase
{
    use TestTrait;

    public function test_it_should_obay_setoid_laws()
    {
        $this->forAll(
            Generator\choose(0, 1000),
            Generator\choose(1000, 4000),
            Generator\choose(4000, 100000)
        )->then(function (int $x, int $y, int $z) {
            SetoidLaws::test(
                [$this, 'assertEquals'],
                Num::of($x),
                Num::of($y),
                Num::of($z)
            );
        });
    }
}

Make Primitive\Num tests much more nicer
Make Primitive\Num tests much more nicer
