Bug 20912: (QA follow-up) Move Fees to Charges::
[koha.git] / t / Search.t
index 286d36a..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 {
-    use_ok('C4::Search');
-    can_ok('C4::Search',
-        qw/_build_initial_query/);
+    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
+use Test::DBIx::Class;
+
+use_ok('C4::Search');
+can_ok('C4::Search',
+    qw/_build_initial_query/);
+
 subtest "_build_initial_query tests" => sub {
 
     plan tests => 20;
@@ -158,4 +170,3 @@ subtest "_build_initial_query tests" => sub {
 };
 
 
-1;