示例#1
0
 /**
  * @param $checkedVariable
  * @return bool
  */
 public static function checkIfPositiveNumberOrThrowAnException($checkedVariable)
 {
     if (Helpers::checkIfPositiveNumber($checkedVariable)) {
         return true;
     }
     throw new InvalidArgumentException(ErrorMessages::getMustBePositiveNumberMessage($checkedVariable));
 }
示例#2
0
 public function testCheckIfPositiveNumberException()
 {
     $this->setExpectedException('InvalidArgumentException', ErrorMessages::getMustBePositiveNumberMessage("0"));
     Helpers::checkIfPositiveNumberOrThrowAnException(0);
 }