/** */ protected function _getFile($path, $name) { $query = array($this->_mdKey(self::FNAME) => $name, $this->_mdKey(self::PATH) => $this->_convertPath($path)); try { return $this->_files->findOne($query); } catch (MongoException $e) { throw new Horde_Vfs_Exception($e); } }
/** * @param \MongoGridFS $gridFs */ function it_should_calculate_checksum($gridFs) { $someFile = new \stdClass(); $someFile->file = array('md5' => 'md5123'); $gridFs->findOne('filename', array('md5'))->willReturn($someFile); $this->checksum('filename')->shouldReturn('md5123'); }
protected function getFile($path) { $file = $this->db->findOne(array("filename" => $this->_basename($path), "metadata.path" => $this->_dirname($path))); return $file; }