Generic test to verify if a type obey the monodic laws.
public static test ( callable $assertEqual, Widmogrod\FantasyLand\Monoid $x, Widmogrod\FantasyLand\Monoid $y, Widmogrod\FantasyLand\Monoid $z ) | ||
$assertEqual | callable | Asserting function (Monoid $m1, Monoid $m2, $message) |
$x | Widmogrod\FantasyLand\Monoid | |
$y | Widmogrod\FantasyLand\Monoid | |
$z | Widmogrod\FantasyLand\Monoid |
/** * @dataProvider provideSetoidLaws */ public function test_it_should_obay_monoid_laws($a, $b, $c) { MonoidLaws::test(f\curryN(3, [$this, 'assertEquals']), $a, $b, $c); }
/** * @dataProvider provideRandomizedData */ public function test_it_should_obey_monoid_laws(Monoid $x, Monoid $y, Monoid $z) { MonoidLaws::test(f\curryN(3, [$this, 'assertEquals']), $x, $y, $z); }