Example #1
0
 /**
  * Checks if value is an integer
  *
  * @param   mixed       $value          Value to evaluate
  * @param   array       $requirements   Array of constraints (OPTIONAL)
  * @return  integer     Cleared value
  * @throws  InvalidDataException        If the value is not integer or fails constraints checks
  */
 public static function checkInteger($value, array $requirements = array())
 {
     return IntegerType::check($value, $requirements);
 }
Example #2
0
 /**
  * @expectedException Ucc\Exception\Data\InvalidDataValueException
  * @expectedExceptionMessage value must be an even number
  */
 public function testCheckFailIntegerWithEvenRequirements()
 {
     $integerType = new IntegerType();
     $expected = 5;
     $requirements = array('even' => true);
     $actual = IntegerType::check($expected, $requirements);
 }