From a49046b504526a6383b18a534f7ea00364e1e193 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Mon, 19 Jun 2017 14:21:58 +0300 Subject: [PATCH] Bug 18721: (follow-up) Restore dbms attribute in class, fix Installer.t This patch restores "dbms" attribute in C4::Installer, since it is used in the class. I also checked if other scripts and modules are using any of the class attributes, but did not notice further issues, apart from Installer.t Removes now unneeded tests from t/db_dependent/Installer.t. To test: 1. prove t/db_dependent/Installer.t --- C4/Installer.pm | 3 +++ t/db_dependent/Installer.t | 12 +----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index 8975cf3..a3592a9 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -73,6 +73,9 @@ sub new { my $self = {}; + # get basic information from context + $self->{'dbms'} = C4::Context->config("db_scheme") + ? C4::Context->config("db_scheme") : "mysql"; $self->{'dbh'} = C4::Context->dbh(); $self->{'language'} = undef; $self->{'marcflavour'} = undef; diff --git a/t/db_dependent/Installer.t b/t/db_dependent/Installer.t index 0b4cfa2..d4d99e8 100644 --- a/t/db_dependent/Installer.t +++ b/t/db_dependent/Installer.t @@ -22,7 +22,7 @@ # Add more tests here!!! use Modern::Perl; -use Test::More tests => 15; +use Test::More tests => 10; use Koha::Database; BEGIN { @@ -31,7 +31,6 @@ BEGIN { ok( my $installer = C4::Installer->new(), 'Testing NewInstaller' ); is( ref $installer, 'C4::Installer', 'Testing class of object' ); -is( $installer->{'dbname'}, C4::Context->config('database'), 'Testing DbName' ); is( $installer->{'dbms'}, C4::Context->config('db_scheme') @@ -39,15 +38,6 @@ is( : 'mysql', 'Testing DbScheme' ); -is( - $installer->{'hostname'}, - C4::Context->config('hostname'), - 'Testing Hostname' -); -is( $installer->{'port'}, C4::Context->config('port'), 'Testing Port' ); -is( $installer->{'user'}, C4::Context->config('user'), 'Testing User' ); -is( $installer->{'password'}, C4::Context->config('pass'), 'Testing Password' ); - # The borrower table is known to have columns and constraints. my $schema = Koha::Database->new->schema; my $source = $schema->source('Borrower'); -- 2.7.4