public function testValidateEmail() { $ssEmail = "shashank@virtueinfo.com1"; $asValidator = array('Zend_Validate_NotEmpty', 'Zend_Validate_EmailAddress'); $oCustomDataValidator = new ZendX_Custom_Data_Validator(); $bIsValid = $oCustomDataValidator->customAddValidatorAndValidateValue($ssEmail, $asValidator); if (!$bIsValid) { $asMassages = $oCustomDataValidator->customGetErrorMassages(); } else { $asMassages = array("success"); } }
/** * For add user detail * When required field given blank * @author Shashank Patel * @access public */ public function testAddUserIfRequireFieldGivenBlank() { $asBlankUser = array('first_name' => 'sdsa', 'last_name' => 'sdasd', 'email' => 'sdasd', 'password' => 'sdsadsa', 'city' => 'Ahmedabad'); $asValidator = array('Zend_Validate_NotEmpty'); $oCustomDataValidator = new ZendX_Custom_Data_Validator(); $bValid = true; foreach ($asBlankUser as $ssField => $ssFieldValue) { var_dump($oCustomDataValidator->customAddValidatorAndValidateValue($ssFieldValue, $asValidator)); if ($oCustomDataValidator->customAddValidatorAndValidateValue($ssFieldValue, $asValidator)) { echo $ssLastField = $ssField; $bValid = false; break; } else { continue; } } var_dump($bValid); exit; //echo $ssLastField."'s Value is required and can't be empty"; $this->assertFalse(true, "No parameter given for adding new record"); }