@@ -11,7 +11,7 @@ class BasicImport extends Nicklayb\LaravelDbImport\Import
1111class ExtendedImport extends Nicklayb \LaravelDbImport \Import
1212{
1313 protected $ ignoreTables = [ 'migrations ' ];
14- protected $ lastTables = [ 'relation_one ' , ' relation_two ' ];
14+ protected $ lastTables = [ 'relation_two ' , ' relation_one ' ];
1515 protected $ selects = [
1616 'users ' => [
1717 'id ' , 'firstname ' , 'lastname '
@@ -89,12 +89,12 @@ public function testHasIgnoreTableInexistant()
8989
9090 public function testHasLastTable ()
9191 {
92- $ this ->assertTrue ($ this ->extendedImport ->hasLastTable ('relation_one ' ));
92+ $ this ->assertEquals ($ this ->extendedImport ->hasLastTable ('relation_one ' ), 1 );
9393 }
9494
9595 public function testHasLastTableInexistant ()
9696 {
97- $ this ->assertFalse ($ this ->extendedImport ->hasLastTable ('products ' ));
97+ $ this ->assertEquals ($ this ->extendedImport ->hasLastTable ('products ' ), - 1 );
9898 }
9999
100100 public function testHasPasswordReset ()
@@ -236,10 +236,12 @@ public function testGetSortedSourceTables()
236236 'products ' ,
237237 'roles ' ,
238238 'orders ' ,
239- 'relation_one ' ,
240- 'relation_two '
239+ 'relation_two ' ,
240+ 'relation_one '
241241 ];
242-
243- $ this ->assertEquals ($ expected , $ this ->extendedImport ->getSortedSourceTables ()->toArray ());
242+ $ tables = $ this ->extendedImport ->getSortedSourceTables ()->toArray ();
243+ for ($ i = 0 ; $ i < count ($ tables ) ; $ i ++) {
244+ $ this ->assertEquals ($ expected [$ i ], $ tables [$ i ]);
245+ }
244246 }
245247}
0 commit comments