Valid parameters for this driver: - (string) databaseName Name of the database. Defaults to 'imbo_imagevariation_storage' - (string) server The server string to use when connecting to MongoDB. Defaults to 'mongodb://localhost:27017' - (array) options Options to use when creating the Mongo client instance. Defaults to ['connect' => true, 'connectTimeoutMS' => 1000].
Author: Christer Edvartsen (cogo@starzinger.net)
Inheritance: implements Imbo\EventListener\ImageVariations\Storage\StorageInterface
Example #1
0
 /**
  * @covers Imbo\EventListener\ImageVariations\Storage\GridFS::__construct
  * @covers Imbo\EventListener\ImageVariations\Storage\GridFS::getGrid
  */
 public function testCanPassGridInstance()
 {
     $client = $this->getMockBuilder('MongoClient')->disableOriginalConstructor()->getMock();
     $grid = $this->getMockBuilder('MongoGridFS')->disableOriginalConstructor()->getMock();
     $grid->expects($this->once())->method('storeBytes')->will($this->returnValue(true));
     $adapter = new GridFS(['databaseName' => $this->databaseName], $client, $grid);
     $adapter->storeImageVariation('key', 'id', 'blob', 700);
 }