Esempio n. 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");
 }
Esempio n. 2
0
 public static function validate($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::VALIDATION_TAG_INDUSTRY);
 }
Esempio n. 3
0
 /**
  * Validate the user type
  * @param $value
  * @return mixed
  */
 public static function validateUserType($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::TAG_USER_TYPE);
 }
Esempio n. 4
0
 public static function validate($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::VALIDATION_TAG_PAYMENT_METHOD);
 }
Esempio n. 5
0
 public static function validateLocale($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::TAG_LOCALE);
 }
Esempio n. 6
0
 public static function validateRiskClass($value)
 {
     return Constants::validateConstant(__CLASS__, $value, 'RISK_CLASS');
 }
Esempio n. 7
0
 public static function validateIssuerType($value)
 {
     return Constants::validateConstant(__CLASS__, $value, 'ISSUER');
 }
Esempio n. 8
0
 public static function validatePaymentMethodType($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::TAG_PAYMENT_METHOD);
 }
Esempio n. 9
0
 /**
  * Validate the company Register type
  * @param $value
  * @return bool
  */
 public static function validateCompanyRegisterType($value)
 {
     return Constants::validateConstant(__CLASS__, $value, 'COMPANY_TYPE');
 }
Esempio n. 10
0
 public static function validateDeliveryTime($value)
 {
     return Constants::validateConstant(__CLASS__, $value, static::TAG_DELIVERY_TIME);
 }