Skip to content
This repository
Browse code

Use MongoId to work around MongoGridFS::get() bug

  • Loading branch information...
commit 5dde9205b7a15da02454b1eccaad7c772f72b782 1 parent 29f47eb
Jeremy Mikola authored December 05, 2012
5  tests/Doctrine/MongoDB/Tests/GridFSTest.php
@@ -134,6 +134,7 @@ public function testUpsertModifierWithoutFile()
134 134
     public function testUpsert()
135 135
     {
136 136
         $gridFS = $this->getGridFS();
  137
+        $id = new \MongoId();
137 138
 
138 139
         $path = __DIR__.'/file.txt';
139 140
         $file = new GridFSFile($path);
@@ -144,9 +145,9 @@ public function testUpsert()
144 145
                 'file' => $file,
145 146
             ),
146 147
         );
147  
-        $gridFS->update(array('_id' => 123), $newObj, array('upsert' => true, 'multiple' => false));
  148
+        $gridFS->update(array('_id' => $id), $newObj, array('upsert' => true, 'multiple' => false));
148 149
 
149  
-        $document = $gridFS->findOne(array('_id' => 123));
  150
+        $document = $gridFS->findOne(array('_id' => $id));
150 151
 
151 152
         $file = $document['file'];
152 153
 

0 notes on commit 5dde920

Please sign in to comment.
Something went wrong with that request. Please try again.