Exemple #1
0
 /**
  * Overwritten validation method to bypass validation
  * when file was uploaded via Uploadify
  *
  * @param string $value File, can be optional, give null to validate all files
  * @param mixed $context
  * @return bool
  */
 public function isValid($value, $context = null)
 {
     if ($this->isUploadify()) {
         $this->_validated = true;
         return true;
     }
     return parent::isValid($value, $context);
 }
Exemple #2
0
 public function isValid($value, $context = null)
 {
     if (!($this->_orginValue === null || isset($_FILES[$this->getName()]))) {
         $this->_validated = true;
         return true;
     }
     return parent::isValid($value, $context);
 }
Exemple #3
0
 /**
  * @group ZF-12210
  */
 public function testAutoInsertNotEmptyValidator()
 {
     $this->testElementShouldAllowSpecifyingAdapterUsingConcreteInstance();
     $this->element->setRequired(true);
     // Test before validation
     $this->assertNull($this->element->getValidator('NotEmpty'));
     // Test after validation
     $this->element->isValid('foo.jpg');
     $this->assertTrue($this->element->getValidator('NotEmpty') instanceof Zend_Validate_NotEmpty);
 }