7 use Test
::More tests
=> 91;
8 use vars
qw($debug $koha $dbh $config $ret);
11 $debug = $ENV{DEBUG} || 0;
12 diag("Note: The overall number of tests may vary by configuration.");
13 diag("First we need to check your environmental variables");
14 for (qw(KOHA_CONF PERL5LIB)) {
15 ok
($ret = $ENV{$_}, "ENV{$_} = $ret");
17 use_ok
('C4::Context');
18 use_ok
('C4::Utils', qw
/ :all /);
21 ok
($koha = C4
::Context
->new, 'C4::Context->new');
22 ok
($dbh = C4
::Context
->dbh(), 'Getting dbh from C4::Context');
23 ok
($ret = C4
::Context
->KOHAVERSION, ' (function) KOHAVERSION = ' . ($ret||''));
24 ok
($ret = $koha->KOHAVERSION, ' $koha->KOHAVERSION = ' . ($ret||''));
25 my @keys = keys %$koha;
26 diag
("Number of keys in \%\$koha: " . scalar @keys);
29 $width = maxwidth
(@keys);
30 $debug and diag
"widest key is $width";
32 foreach (sort @keys) {
33 ok
(exists $koha->{$_},
34 '$koha->{' . sprintf('%' . $width . 's', $_) . '} exists '
35 . ((defined $koha->{$_}) ?
"and is defined." : "but is not defined.")
38 diag
"Examining defined key values.";
39 foreach (grep {defined $koha->{$_}} sort @keys) {
41 hashdump
('$koha->{' . sprintf('%' . $width . 's', $_) . '}', $koha->{$_});
43 ok
($config = $koha->{config
}, 'Getting $koha->{config} ');
45 # diag("Examining configuration.");
46 diag
("Note: The overall number of tests may vary by configuration. Disregard the projected number.");