public function testFrozenOutputIsMasked()
 {
     $input = new HTML_QuickForm2_Element_InputPassword('foo');
     $input->setValue('bar');
     $input->toggleFrozen(true);
     // wow, never used lookbehind assertions before
     $this->assertNotRegExp('/(?<!value=")bar/', $input->__toString());
     $input->persistentFreeze(false);
     $this->assertNotRegexp('/bar/', $input->__toString());
 }
Exemplo n.º 2
0
 public function validateOldPass($vars, HTML_QuickForm2_Element_InputPassword $el)
 {
     $vars = $el->getContainer()->getValue();
     if ($vars['pass'] != '') {
         if ($vars['_oldpass'] == '') {
             return $this->___('Please enter your current password for validation');
         }
         if (!Am_Di::getInstance()->user->checkPassword($vars['_oldpass'])) {
             return $this->___('Current password entered incorrectly, please try again');
         }
     }
 }