/** * @covers Imbo\Storage\GridFS::store * @covers Imbo\Storage\GridFS::imageExists */ public function testStore() { $data = 'some content'; $cursor = $this->getMockBuilder('MongoGridFSCursor')->disableOriginalConstructor()->getMock(); $cursor->expects($this->once())->method('count')->will($this->returnValue(0)); $this->grid->expects($this->at(0))->method('find')->with(array('publicKey' => $this->publicKey, 'imageIdentifier' => $this->imageIdentifier))->will($this->returnValue($cursor)); $this->grid->expects($this->once())->method('storeBytes')->with($data, $this->isType('array')); $this->assertTrue($this->driver->store($this->publicKey, $this->imageIdentifier, $data)); }