Esempio n. 1
0
 public function testGenerateWithAlternatingStrategy()
 {
     $scope = new Scope('scope1');
     $gen = new MersenneRandom(700);
     $result = '';
     $scope->setMinOccurances(7);
     $scope->setMaxOccurances(7);
     for ($i = 1; $i <= 6; $i++) {
         $lit = new LiteralScope('label_' . $i);
         $lit->addLiteral($i);
         $scope->attach($lit);
         $lit = null;
     }
     $scope->useAlternatingStrategy();
     $scope->generate($result, $gen);
     $this->assertRegExp('/[1-6]{7}/', $result);
 }