@@ -288,9 +288,9 @@ public function testGetUniqueIndexes()
288
288
));
289
289
$ this ->assertTrue (Schema::hasIndex ('foo ' , 'foo_baz_bar_unique ' ));
290
290
$ this ->assertTrue (Schema::hasIndex ('foo ' , 'foo_baz_bar_unique ' , 'unique ' ));
291
- $ this ->assertTrue (Schema::hasIndex ('foo ' , ['bar ' , 'baz ' ]));
292
- $ this ->assertTrue (Schema::hasIndex ('foo ' , ['bar ' , 'baz ' ], 'unique ' ));
293
- $ this ->assertFalse (Schema::hasIndex ('foo ' , ['bar ' , 'baz ' ], 'primary ' ));
291
+ $ this ->assertTrue (Schema::hasIndex ('foo ' , ['baz ' , 'bar ' ]));
292
+ $ this ->assertTrue (Schema::hasIndex ('foo ' , ['baz ' , 'bar ' ], 'unique ' ));
293
+ $ this ->assertFalse (Schema::hasIndex ('foo ' , ['baz ' , 'bar ' ], 'primary ' ));
294
294
}
295
295
296
296
public function testGetIndexesWithCompositeKeys ()
@@ -335,6 +335,26 @@ public function testGetFullTextIndexes()
335
335
$ this ->assertTrue (collect ($ indexes )->contains ('name ' , 'articles_body_title_fulltext ' ));
336
336
}
337
337
338
+ public function testHasIndexOrder ()
339
+ {
340
+ Schema::create ('foo ' , function (Blueprint $ table ) {
341
+ $ table ->integer ('bar ' );
342
+ $ table ->integer ('baz ' );
343
+ $ table ->integer ('qux ' );
344
+
345
+ $ table ->unique (['bar ' , 'baz ' ]);
346
+ $ table ->index (['baz ' , 'bar ' ]);
347
+ $ table ->index (['baz ' , 'qux ' ]);
348
+ });
349
+
350
+ $ this ->assertTrue (Schema::hasIndex ('foo ' , ['bar ' , 'baz ' ]));
351
+ $ this ->assertTrue (Schema::hasIndex ('foo ' , ['bar ' , 'baz ' ], 'unique ' ));
352
+ $ this ->assertTrue (Schema::hasIndex ('foo ' , ['baz ' , 'bar ' ]));
353
+ $ this ->assertFalse (Schema::hasIndex ('foo ' , ['baz ' , 'bar ' ], 'unique ' ));
354
+ $ this ->assertTrue (Schema::hasIndex ('foo ' , ['baz ' , 'qux ' ]));
355
+ $ this ->assertFalse (Schema::hasIndex ('foo ' , ['qux ' , 'baz ' ]));
356
+ }
357
+
338
358
public function testGetForeignKeys ()
339
359
{
340
360
Schema::create ('users ' , function (Blueprint $ table ) {
0 commit comments