Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

Commit

Permalink
Use MongoId to work around MongoGridFS::get() bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Dec 5, 2012
1 parent 29f47eb commit 5dde920
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/Doctrine/MongoDB/Tests/GridFSTest.php
Expand Up @@ -134,6 +134,7 @@ public function testUpsertModifierWithoutFile()
public function testUpsert()
{
$gridFS = $this->getGridFS();
$id = new \MongoId();

$path = __DIR__.'/file.txt';
$file = new GridFSFile($path);
Expand All @@ -144,9 +145,9 @@ public function testUpsert()
'file' => $file,
),
);
$gridFS->update(array('_id' => 123), $newObj, array('upsert' => true, 'multiple' => false));
$gridFS->update(array('_id' => $id), $newObj, array('upsert' => true, 'multiple' => false));

$document = $gridFS->findOne(array('_id' => 123));
$document = $gridFS->findOne(array('_id' => $id));

$file = $document['file'];

Expand Down

0 comments on commit 5dde920

Please sign in to comment.