public function testStoreFileExceptionWhileUpdatingFileRecord()
{
$collection = $this->getGridFS();
$collection->createIndex(['length' => 1], ['unique' => true]);
$document = ['length' => filesize(__FILE__)];
$collection->insert($document);
$this->setExpectedExceptionRegExp('MongoGridFSException', '/Could not store file:.* E11000 duplicate key error .* mongo-php-adapter\\.fs\\.files/');
$collection->storeFile(fopen(__FILE__, 'r'));
}