From 8205529683da0f934f4bdb26ccd54f05b8246d0a 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 --- 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 9bad321e92..6775b8e998 100755 --- a/t/Context.t +++ b/t/Context.t @@ -2,7 +2,7 @@ use Modern::Perl; use DBI; -use Test::More tests => 16; +use Test::More tests => 14; use Test::MockModule; BEGIN { @@ -45,8 +45,3 @@ is(C4::Context::db_scheme2dbi('mysql'), 'mysql', 'ask for mysql, get mysql'); is(C4::Context::db_scheme2dbi('Pg'), 'Pg', 'ask for Pg, get Pg'); is(C4::Context::db_scheme2dbi('xxx'), 'mysql', 'ask for unsupported DBMS, get mysql'); is(C4::Context::db_scheme2dbi(), 'mysql', 'ask for nothing, get mysql'); - -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