public function testGenerators() { $generators = ["Gen\\neg" => Generator\neg(), "Gen\\pos" => Generator\pos()]; foreach ($generators as $description => $generator) { $this->generateSample($description, $generator); } }
public function testSumIsAssociative() { $this->forAll(Generator\int(), Generator\neg(), Generator\pos())->then(function ($first, $second, $third) { $x = $first + ($second + $third); $y = $first + $second + $third; $this->assertEquals($x, $y, "Sum between {$first} and {$second} should be associative"); }); }
public function testPositiveOrNegativeNumberButNotZero() { $this->forAll(Generator\oneOf(Generator\pos(), Generator\neg()))->then(function ($number) { $this->assertNotEquals(0, $number); }); }