public function testGenerators()
 {
     $generators = ["Gen\\neg" => Generator\neg(), "Gen\\pos" => Generator\pos()];
     foreach ($generators as $description => $generator) {
         $this->generateSample($description, $generator);
     }
 }
Exemple #2
0
 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");
     });
 }
Exemple #3
0
 public function testPositiveOrNegativeNumberButNotZero()
 {
     $this->forAll(Generator\oneOf(Generator\pos(), Generator\neg()))->then(function ($number) {
         $this->assertNotEquals(0, $number);
     });
 }