View | Details | Raw Unified | Return to bug 18721
Collapse All | Expand All

(-)a/C4/Installer.pm (+3 lines)
Lines 73-78 sub new { Link Here
73
73
74
    my $self = {};
74
    my $self = {};
75
75
76
    # get basic information from context
77
    $self->{'dbms'}  = C4::Context->config("db_scheme")
78
                        ? C4::Context->config("db_scheme") : "mysql";
76
    $self->{'dbh'} = C4::Context->dbh();
79
    $self->{'dbh'} = C4::Context->dbh();
77
    $self->{'language'} = undef;
80
    $self->{'language'} = undef;
78
    $self->{'marcflavour'} = undef;
81
    $self->{'marcflavour'} = undef;
(-)a/t/db_dependent/Installer.t (-12 / +1 lines)
Lines 22-28 Link Here
22
# Add more tests here!!!
22
# Add more tests here!!!
23
23
24
use Modern::Perl;
24
use Modern::Perl;
25
use Test::More tests => 15;
25
use Test::More tests => 10;
26
use Koha::Database;
26
use Koha::Database;
27
27
28
BEGIN {
28
BEGIN {
Lines 31-37 BEGIN { Link Here
31
31
32
ok( my $installer = C4::Installer->new(), 'Testing NewInstaller' );
32
ok( my $installer = C4::Installer->new(), 'Testing NewInstaller' );
33
is( ref $installer, 'C4::Installer', 'Testing class of object' );
33
is( ref $installer, 'C4::Installer', 'Testing class of object' );
34
is( $installer->{'dbname'}, C4::Context->config('database'), 'Testing DbName' );
35
is(
34
is(
36
    $installer->{'dbms'},
35
    $installer->{'dbms'},
37
    C4::Context->config('db_scheme')
36
    C4::Context->config('db_scheme')
Lines 39-53 is( Link Here
39
    : 'mysql',
38
    : 'mysql',
40
    'Testing DbScheme'
39
    'Testing DbScheme'
41
);
40
);
42
is(
43
    $installer->{'hostname'},
44
    C4::Context->config('hostname'),
45
    'Testing Hostname'
46
);
47
is( $installer->{'port'},     C4::Context->config('port'), 'Testing Port' );
48
is( $installer->{'user'},     C4::Context->config('user'), 'Testing User' );
49
is( $installer->{'password'}, C4::Context->config('pass'), 'Testing Password' );
50
51
# The borrower table is known to have columns and constraints.
41
# The borrower table is known to have columns and constraints.
52
my $schema = Koha::Database->new->schema;
42
my $schema = Koha::Database->new->schema;
53
my $source = $schema->source('Borrower');
43
my $source = $schema->source('Borrower');
54
- 

Return to bug 18721