コード例 #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;
 }