@@ -93,7 +93,7 @@ public function testDropIndex()
9393 {
9494 Schema::collection ('newcollection ' , function ($ collection ) {
9595 $ collection ->unique ('uniquekey ' );
96- $ collection ->dropIndex ('uniquekey ' );
96+ $ collection ->dropIndex ('uniquekey_1 ' );
9797 });
9898
9999 $ index = $ this ->getIndex ('newcollection ' , 'uniquekey ' );
@@ -106,6 +106,34 @@ public function testDropIndex()
106106
107107 $ index = $ this ->getIndex ('newcollection ' , 'uniquekey ' );
108108 $ this ->assertEquals (null , $ index );
109+
110+ Schema::collection ('newcollection ' , function ($ collection ) {
111+ $ collection ->index (['field_a ' , 'field_b ' ]);
112+ });
113+
114+ $ index = $ this ->getIndex ('newcollection ' , 'field_a_1_field_b_1 ' );
115+ $ this ->assertNotNull ($ index );
116+
117+ Schema::collection ('newcollection ' , function ($ collection ) {
118+ $ collection ->dropIndex (['field_a ' , 'field_b ' ]);
119+ });
120+
121+ $ index = $ this ->getIndex ('newcollection ' , 'field_a_1_field_b_1 ' );
122+ $ this ->assertFalse ($ index );
123+
124+ Schema::collection ('newcollection ' , function ($ collection ) {
125+ $ collection ->index (['field_a ' , 'field_b ' ], 'custom_index_name ' );
126+ });
127+
128+ $ index = $ this ->getIndex ('newcollection ' , 'custom_index_name ' );
129+ $ this ->assertNotNull ($ index );
130+
131+ Schema::collection ('newcollection ' , function ($ collection ) {
132+ $ collection ->dropIndex ('custom_index_name ' );
133+ });
134+
135+ $ index = $ this ->getIndex ('newcollection ' , 'custom_index_name ' );
136+ $ this ->assertFalse ($ index );
109137 }
110138
111139 public function testBackground ()
0 commit comments