예제 #1
0
파일: HashTest.php 프로젝트: haoyanfei/zf2
 /**
  * Ensures that setHash() returns expected value
  *
  * @return void
  */
 public function testSetHash()
 {
     $validator = new File\Hash('12345');
     $validator->setHash('12333');
     $this->assertEquals(array('12333' => 'crc32'), $validator->getHash());
     $validator->setHash(array('12321', '12121'));
     $this->assertEquals(array('12321' => 'crc32', '12121' => 'crc32'), $validator->getHash());
 }
예제 #2
0
파일: Crc32.php 프로젝트: alab1001101/zf2
 /**
  * Sets the crc32 hash for one or multiple files
  *
  * @param  string|array $options
  * @return \Zend\Validator\File\Hash Provides a fluent interface
  */
 public function setHash($options)
 {
     if (!is_array($options)) {
         $options = array($options);
     }
     $options['algorithm'] = 'crc32';
     parent::setHash($options);
     return $this;
 }
예제 #3
0
파일: Md5.php 프로젝트: alab1001101/zf2
 /**
  * Sets the md5 hash for one or multiple files
  *
  * @param  string|array $options
  * @param  string       $algorithm (Deprecated) Algorithm to use, fixed to md5
  * @return \Zend\Validator\File\Hash Provides a fluent interface
  */
 public function setHash($options)
 {
     if (!is_array($options)) {
         $options = (array) $options;
     }
     $options['algorithm'] = 'md5';
     parent::setHash($options);
     return $this;
 }