public function testDifferentSteps()
 {
     for ($i = 2; $i <= 5; $i++) {
         $array = array(1 * $i, 2 * $i, 3 * $i, 4 * $i, 5 * $i);
         $validator = new SequenceValidator($i);
         $validator->validate($array);
     }
 }
Пример #2
0
 /**
  * @param Sudoku $sudoku
  */
 public function check(Sudoku $sudoku)
 {
     foreach ($sudoku->getRows() as $row) {
         $this->uniqueValidator->validate($row->getAsArray());
         $this->sequenceValidator->validate($row->getAsArray());
     }
     foreach ($sudoku->getColumns() as $column) {
         $this->uniqueValidator->validate($column->getAsArray());
         $this->sequenceValidator->validate($column->getAsArray());
     }
     foreach ($sudoku->getBoxes() as $box) {
         $this->uniqueValidator->validate($box->getAs1dArray());
         $this->sequenceValidator->validate($box->getAs1dArray());
     }
 }