Bug 11701: Unit tests for C4::Context::Zconn
authorJulian Maurice <julian.maurice@biblibre.com>
Thu, 6 Feb 2014 16:09:50 +0000 (17:09 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 25 Mar 2014 14:38:21 +0000 (14:38 +0000)
TEST PLAN
---------
1) apply patch
2) run koha qa test tool
3) prove -v t/Context.t

Unit tests ran as expected.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
t/Context.t

index 6775b8e..9bad321 100755 (executable)
@@ -2,7 +2,7 @@
 
 use Modern::Perl;
 use DBI;
-use Test::More tests => 14;
+use Test::More tests => 16;
 use Test::MockModule;
 
 BEGIN {
@@ -45,3 +45,8 @@ 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");