@@ -93,7 +93,7 @@ public function testDropIndex()
93
93
{
94
94
Schema::collection ('newcollection ' , function ($ collection ) {
95
95
$ collection ->unique ('uniquekey ' );
96
- $ collection ->dropIndex ('uniquekey ' );
96
+ $ collection ->dropIndex ('uniquekey_1 ' );
97
97
});
98
98
99
99
$ index = $ this ->getIndex ('newcollection ' , 'uniquekey ' );
@@ -106,6 +106,34 @@ public function testDropIndex()
106
106
107
107
$ index = $ this ->getIndex ('newcollection ' , 'uniquekey ' );
108
108
$ 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 );
109
137
}
110
138
111
139
public function testBackground ()
0 commit comments