/** * Ensures that addHash() returns expected value * * @return void */ public function testAddHash() { $validator = new File\Hash('12345'); $validator->addHash('12344'); $this->assertEquals(array('12345' => 'crc32', '12344' => 'crc32'), $validator->getHash()); $validator->addHash(array('12321', '12121')); $this->assertEquals(array('12345' => 'crc32', '12344' => 'crc32', '12321' => 'crc32', '12121' => 'crc32'), $validator->getHash()); }
/** * Adds the crc32 hash for one or multiple files * * @param string|array $options * @return \Zend\Validator\File\Hash Provides a fluent interface */ public function addHash($options) { if (!is_array($options)) { $options = array($options); } $options['algorithm'] = 'crc32'; parent::addHash($options); return $this; }