Exemplo n.º 1
0
 /**
  *
  * @param type $min
  * @param type $max
  * @param type $messages_prefixed
  * @return \Zend_Validate_File_Count 
  */
 protected function _getValidatorFileCount($min = 0, $max = 1, $messages_prefixed = "")
 {
     $file = new Zend_Validate_File_Count(array('min' => $min, 'max' => $max));
     $file->setMessage(sprintf($this->_translate('ERROR_FILE_COUNT_TO_FEW'), $this->_translate($messages_prefixed), $min), Zend_Validate_File_Count::TOO_FEW);
     $file->setMessage(sprintf($this->_translate('ERROR_FILE_COUNT_TO_MANY'), $this->_translate($messages_prefixed), $max), Zend_Validate_File_Count::TOO_MANY);
     return $file;
 }
Exemplo n.º 2
0
 /**
  * Ensures that setMax() returns expected value
  *
  * @return void
  */
 public function testSetMax()
 {
     $validator = new Zend_Validate_File_Count(array('min' => 1000, 'max' => 10000));
     $validator->setMax(1000000);
     $this->assertEquals(1000000, $validator->getMax());
     $validator->setMin(100);
     $this->assertEquals(1000000, $validator->getMax());
 }
Exemplo n.º 3
0
 /**
  * Ensures that setMax() returns expected value
  *
  * @return void
  */
 public function testSetMax()
 {
     $validator = new Zend_Validate_File_Count(1000, 10000);
     $validator->setMax(1000000);
     $this->assertEquals(1000000, $validator->getMax());
     $validator->setMin(100);
     $this->assertEquals(1000000, $validator->getMax());
     $validator->setMax(null);
     $this->assertEquals(null, $validator->getMax());
 }