示例#1
0
 /**
  * Check if the given data is ok for the given codice fiscale.
  *
  * @returns Returns true if the codice fiscale is ok, false otherwise.
  */
 public function check()
 {
     $calculator = new Calculator($this->subject, array('omocodiaLevel' => $this->omocodiaLevel));
     if ($this->omocodiaLevel == self::ALL_OMOCODIA_LEVELS) {
         $values = $calculator->calculateAllPossibilities();
     } else {
         $values = array($calculator->calculate());
     }
     return in_array($this->codiceFiscaleToCheck, $values);
 }
 /**
  * Test for calculateAllPossibilities.
  *
  * @dataProvider calculateAllPossibilitiesProvider
  */
 public function testCalculateAllPossibilities($subject, $expected)
 {
     $calculator = new Calculator($subject);
     $actual = $calculator->calculateAllPossibilities();
     $this->assertEquals($expected, $actual);
 }