Beispiel #1
0
 public function testValidateConstant()
 {
     $request = new CustomValidationRequest();
     $className = get_class($request);
     $className = "\\" . $className;
     /**
      * Test successful validation
      */
     $result = Constants::validateConstant($className, 1, 'CUSTOM_TEST');
     $this->assertTrue($result, "Constant validation did not work");
     /**
      * Test unsuccessful validation
      */
     $result = Constants::validateConstant($className, 10, 'CUSTOM_TEST');
     $this->assertFalse($result, "Constant validation did not work");
     /**
      * Test unsuccessful validation
      */
     $result = Constants::validateConstant($className, "10", 'CUSTOM_TEST');
     $this->assertFalse($result, "Constant validation did not work");
 }
Beispiel #2
0
 public static function validate($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::VALIDATION_TAG_INDUSTRY);
 }
 /**
  * Validate the user type
  * @param $value
  * @return mixed
  */
 public static function validateUserType($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::TAG_USER_TYPE);
 }
Beispiel #4
0
 public static function validate($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::VALIDATION_TAG_PAYMENT_METHOD);
 }
Beispiel #5
0
 public static function validateLocale($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::TAG_LOCALE);
 }
Beispiel #6
0
 public static function validateRiskClass($value)
 {
     return Constants::validateConstant(__CLASS__, $value, 'RISK_CLASS');
 }
 public static function validateIssuerType($value)
 {
     return Constants::validateConstant(__CLASS__, $value, 'ISSUER');
 }
 public static function validatePaymentMethodType($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::TAG_PAYMENT_METHOD);
 }
Beispiel #9
0
 /**
  * Validate the company Register type
  * @param $value
  * @return bool
  */
 public static function validateCompanyRegisterType($value)
 {
     return Constants::validateConstant(__CLASS__, $value, 'COMPANY_TYPE');
 }
 public static function validateDeliveryTime($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::TAG_DELIVERY_TIME);
 }