Пример #1
0
 /**
  * @param $checkedVariable
  * @return bool
  */
 public static function checkIfNotNegativeNumberOrThrowAnException($checkedVariable)
 {
     if (Helpers::checkIfNotNegativeNumber($checkedVariable)) {
         return true;
     }
     throw new InvalidArgumentException(ErrorMessages::getMustNotBeNegativeNumberMessage($checkedVariable));
 }
Пример #2
0
 public function testCheckIfNotNegativeNumberException()
 {
     $this->setExpectedException('InvalidArgumentException', ErrorMessages::getMustNotBeNegativeNumberMessage("-6"));
     Helpers::checkIfNotNegativeNumberOrThrowAnException(-6);
 }