@@ -52,19 +52,38 @@ public function testIndex()
5252 {
5353 Schema::collection ('newcollection ' , function ($ collection )
5454 {
55- $ collection ->index ('mykey ' );
55+ $ collection ->index ('mykey1 ' );
5656 });
5757
58- $ index = $ this ->getIndex ('newcollection ' , 'mykey ' );
59- $ this ->assertEquals (1 , $ index ['key ' ]['mykey ' ]);
58+ $ index = $ this ->getIndex ('newcollection ' , 'mykey1 ' );
59+ $ this ->assertEquals (1 , $ index ['key ' ]['mykey1 ' ]);
60+
61+ Schema::collection ('newcollection ' , function ($ collection )
62+ {
63+ $ collection ->index (['mykey2 ' ]);
64+ });
65+
66+ $ index = $ this ->getIndex ('newcollection ' , 'mykey2 ' );
67+ $ this ->assertEquals (1 , $ index ['key ' ]['mykey2 ' ]);
68+
69+ Schema::collection ('newcollection ' , function ($ collection )
70+ {
71+ $ collection ->string ('mykey3 ' )->index ();
72+ });
6073
74+ $ index = $ this ->getIndex ('newcollection ' , 'mykey3 ' );
75+ $ this ->assertEquals (1 , $ index ['key ' ]['mykey3 ' ]);
76+ }
77+
78+ public function testPrimary ()
79+ {
6180 Schema::collection ('newcollection ' , function ($ collection )
6281 {
63- $ collection ->index ([ 'mykey ' ] );
82+ $ collection ->string ( 'mykey ' , 100 )-> primary ( );
6483 });
6584
6685 $ index = $ this ->getIndex ('newcollection ' , 'mykey ' );
67- $ this ->assertEquals (1 , $ index ['key ' ][ ' mykey ' ]);
86+ $ this ->assertEquals (1 , $ index ['unique ' ]);
6887 }
6988
7089 public function testUnique ()
0 commit comments