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