Fix test suite to work again with DBICTEST_SQLITE_USE_FILE
[dbsrgits/DBIx-Class.git] / t / prefetch / correlated.t
index ac809f3..5196620 100644 (file)
@@ -4,8 +4,7 @@ use warnings;
 use Test::More;
 use Test::Deep;
 use lib qw(t/lib);
-use DBICTest;
-use DBIC::SqlMakerTest;
+use DBICTest ':DiffSQL';
 
 my $schema = DBICTest->init_schema();
 
@@ -14,7 +13,7 @@ my $cdrs = $schema->resultset('CD')->search({ 'me.artist' => { '!=', 2 }});
 my $cd_data = { map {
   $_->cdid => {
     siblings => $cdrs->search ({ artist => $_->get_column('artist') })->count - 1,
-    track_titles => [ map { $_->title } ($_->tracks->all) ],
+    track_titles => [ sort $_->tracks->get_column('title')->all ],
   },
 } ( $cdrs->all ) };
 
@@ -66,7 +65,7 @@ $schema->is_executed_querycount( sub {
   cmp_deeply (
     { map
       { $_->cdid => {
-        track_titles => [ map { $_->title } ($_->tracks->all) ],
+        track_titles => [ sort map { $_->title } ($_->tracks->all) ],
         siblings => $_->get_column ('sibling_count'),
       } }
       $c_rs->all
@@ -130,6 +129,8 @@ is_same_sql_bind(
   'Expected SQL on correlated realiased subquery'
 );
 
+$schema->storage->disconnect;
+
 # test for subselect identifier leakage
 # NOTE - the hodge-podge mix of literal and regular identifuers is *deliberate*
 for my $quote_names (0,1) {