Introducing DBIx::Class::Schema::SanityChecker
[dbsrgits/DBIx-Class.git] / t / cdbi / testlib / DBIC / Test / SQLite.pm
index 905ed88..87a17f2 100644 (file)
@@ -1,6 +1,9 @@
 package # hide from PAUSE
     DBIC::Test::SQLite;
 
+use strict;
+use warnings;
+
 =head1 NAME
 
 DBIx::Class::Test::SQLite - Base class for running Class::DBI tests against DBIx::Class compat layer, shamelessly ripped from Class::DBI::Test::SQLite
@@ -31,25 +34,31 @@ table, and tie it to the class.
 
 =cut
 
-use strict;
-use warnings;
-
-use Test::More;
-
 # adding implicit search criteria to the iterator will alter the test
 # mechanics - leave everything as-is instead, and hope SQLite won't
 # change too much
 BEGIN { $ENV{DBIC_SHUFFLE_UNORDERED_RESULTSETS} = 0 }
 
-use lib 't/lib';
 use DBICTest;
 
+use base qw/DBIx::Class/;
+
 BEGIN {
-  eval { require DBIx::Class::CDBICompat }
-    or plan skip_all => 'Class::DBI required for this test';
-}
+  # offset the warning from DBIx::Class::Schema on 5.8
+  # keep the ::Schema default as-is otherwise
+  DBIx::Class::_ENV_::OLD_MRO
+    and
+  ( eval <<'EOS' or die $@ );
+
+  sub setup_schema_instance {
+    my $s = shift->next::method(@_);
+    $s->schema_sanity_checker('');
+    $s;
+  }
 
-use base qw/DBIx::Class/;
+  1;
+EOS
+}
 
 __PACKAGE__->load_components(qw/CDBICompat Core DB/);