@@ -234,10 +234,10 @@ public function testPull()
234
234
public function testDistinct ()
235
235
{
236
236
DB ::collection ('items ' )->insert (array (
237
- array ('name ' => 'knife ' , 'type ' => 'sharp ' , ' amount ' => 34 ),
238
- array ('name ' => 'fork ' , 'type ' => 'sharp ' , ' amount ' => 20 ),
239
- array ('name ' => 'spoon ' , 'type ' => 'round ' , ' amount ' => 3 ),
240
- array ('name ' => 'spoon ' , 'type ' => 'round ' , ' amount ' => 14 )
237
+ array ('name ' => 'knife ' , 'type ' => 'sharp ' ,),
238
+ array ('name ' => 'fork ' , 'type ' => 'sharp ' ),
239
+ array ('name ' => 'spoon ' , 'type ' => 'round ' ),
240
+ array ('name ' => 'spoon ' , 'type ' => 'round ' )
241
241
));
242
242
243
243
$ items = DB ::collection ('items ' )->distinct ('name ' )->get ();
@@ -260,6 +260,14 @@ public function testCustomId()
260
260
261
261
$ item = DB ::collection ('items ' )->where ('_id ' , 'fork ' )->first ();
262
262
$ this ->assertEquals ('fork ' , $ item ['_id ' ]);
263
+
264
+ DB ::collection ('users ' )->insert (array (
265
+ array ('_id ' => 1 , 'name ' => 'Jane Doe ' ),
266
+ array ('_id ' => 2 , 'name ' => 'John Doe ' )
267
+ ));
268
+
269
+ $ item = DB ::collection ('users ' )->find (1 );
270
+ $ this ->assertEquals (1 , $ item ['_id ' ]);
263
271
}
264
272
265
273
public function testTake ()
0 commit comments