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 testGeneratedDataCollectionOnScalars() { $this->forAll(Generator\neg())->hook(Listener\collectFrequencies())->then(function ($x) { $this->assertTrue($x < $x + 1); }); }
public function testPositiveOrNegativeNumberButNotZero() { $this->forAll(Generator\oneOf(Generator\pos(), Generator\neg()))->then(function ($number) { $this->assertNotEquals(0, $number); }); }