Bug 22219: Add tests
[koha.git] / t / Search.t
index 5618ead..0959c85 100755 (executable)
 
 use Modern::Perl;
 
-use Test::More tests => 3;
+use Test::More;
 use t::lib::Mocks;
 
+use Module::Load::Conditional qw/check_install/;
+
+BEGIN {
+    if ( check_install( module => 'Test::DBIx::Class' ) ) {
+        plan tests => 3;
+    } else {
+        plan skip_all => "Need Test::DBIx::Class"
+    }
+}
+
 # Mock the DB connexion and C4::Context
-my $context =  t::lib::Mocks::mock_dbh;
+use Test::DBIx::Class;
 
 use_ok('C4::Search');
 can_ok('C4::Search',
@@ -160,4 +170,3 @@ subtest "_build_initial_query tests" => sub {
 };
 
 
-1;