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