From 8e3c4c75c4312b7632545fd3f140c8de99656931 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 25 Mar 2014 14:41:07 +0000 Subject: [PATCH] Bug 11701: (follow-up) move unit tests to t/db_dependent The new tests will not function if there isn't a valid configuration (or mocking of preference()) so this patch moves them to t/db_dependent/Context.t. To test: [1] After applying the main patch for this bug, verify that prove -v t/db_dependent/Context.t passes. Signed-off-by: Galen Charlton (cherry picked from commit 8205529683da0f934f4bdb26ccd54f05b8246d0a) Signed-off-by: Fridolin Somers Conflicts: t/Context.t --- t/Context.t | 7 +------ t/db_dependent/Context.t | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/t/Context.t b/t/Context.t index b9f9116c77..12d1675781 100755 --- a/t/Context.t +++ b/t/Context.t @@ -2,14 +2,9 @@ use strict; use warnings; use DBI; -use Test::More tests => 3; +use Test::More tests => 1; use Test::MockModule; BEGIN { use_ok('C4::Context'); } - -my $oConnection = C4::Context->Zconn('biblioserver', 0); -isnt($oConnection->option('async'), 1, "ZOOM connection is synchronous"); -$oConnection = C4::Context->Zconn('biblioserver', 1); -is($oConnection->option('async'), 1, "ZOOM connection is asynchronous"); diff --git a/t/db_dependent/Context.t b/t/db_dependent/Context.t index d9f6f32da0..70ced26cd8 100755 --- a/t/db_dependent/Context.t +++ b/t/db_dependent/Context.t @@ -98,6 +98,11 @@ is(C4::Context->preference("SillyPreference"), 'thing4', "Retrieved syspref (val $history = $dbh->{mock_all_history}; is(scalar(@{$history}), 0, 'Did not retrieve syspref from database'); +my $oConnection = C4::Context->Zconn('biblioserver', 0); +isnt($oConnection->option('async'), 1, "ZOOM connection is synchronous"); +$oConnection = C4::Context->Zconn('biblioserver', 1); +is($oConnection->option('async'), 1, "ZOOM connection is asynchronous"); + done_testing(); sub TransformVersionToNum { -- 2.39.5