Пример #1
0
 public function testValidatingAgainstTokenWithNonMatchingValueSetsNotSameMessage()
 {
     $this->testValidatingAgainstTokenWithNonMatchingValueReturnsFalse();
     $messages = $this->validator->getMessages();
     $this->assertTrue(array_key_exists('notSame', $messages));
 }
Пример #2
0
 /**
  * Validates the password
  *
  * @return boolean
  */
 protected function _validatePassword()
 {
     $validator = new Sanmax_Validate_PasswordStrength();
     $validator->setRequireDigit(false)->setRequireLowercase(false)->setRequireUppercase(false);
     $msg = Sanmax_MessageStack::getInstance('SxCms_User');
     if (!$validator->isValid($this->_user->getPassword())) {
         $msg->addMessage('password', $validator->getMessages());
         return false;
     }
     $validator = new Zend_Validate_Identical($this->_user->getPassword());
     if (!$validator->isValid($this->_passwordRepeat)) {
         $msg->addMessage('password_repeat', $validator->getMessages(), 'password');
     }
     return false == ($msg->getMessages('password') && $msg->getMessages('password_repeat'));
 }