|
Lines 17-25
Link Here
|
| 17 |
# with this program; if not, write to the Free Software Foundation, Inc., |
17 |
# with this program; if not, write to the Free Software Foundation, Inc., |
| 18 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
18 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 |
|
19 |
|
| 20 |
use strict; |
20 |
use Modern::Perl; |
| 21 |
use warnings; |
|
|
| 22 |
|
21 |
|
|
|
22 |
use Carp; |
| 23 |
use File::Basename; |
| 24 |
use File::Spec; |
| 23 |
use Getopt::Long; |
25 |
use Getopt::Long; |
| 24 |
use C4::Context; |
26 |
use C4::Context; |
| 25 |
|
27 |
|
|
Lines 30-44
GetOptions( 'showsql' => \$showsql );
Link Here
|
| 30 |
|
32 |
|
| 31 |
use Test::More qw(no_plan); |
33 |
use Test::More qw(no_plan); |
| 32 |
our $dbh = C4::Context->dbh; |
34 |
our $dbh = C4::Context->dbh; |
| 33 |
my $root_dir = C4::Context->config('intranetdir') . '/installer/data/mysql'; |
35 |
my $root_dir = File::Spec->rel2abs( dirname(__FILE__) . '/../../installer/data/mysql' ); |
| 34 |
my $base_syspref_file = "sysprefs.sql"; |
36 |
my $base_syspref_file = "sysprefs.sql"; |
| 35 |
|
37 |
|
| 36 |
open( my $ref_fh, "<$root_dir/$base_syspref_file" ); |
38 |
open my $ref_fh, '<', "$root_dir/$base_syspref_file" or croak "Can't open '$root_dir/$base_syspref_file': $!"; |
| 37 |
my $ref_syspref = get_syspref_from_file($ref_fh); |
39 |
my $ref_syspref = get_syspref_from_file($ref_fh); |
| 38 |
my @ref_sysprefs = sort { lc $a cmp lc $b } keys %$ref_syspref; |
40 |
my @ref_sysprefs = sort { lc $a cmp lc $b } keys %$ref_syspref; |
|
|
41 |
my $num_sysprefs = scalar @ref_sysprefs; |
| 39 |
if ( !$showsql ) { |
42 |
if ( !$showsql ) { |
| 40 |
cmp_ok( $#ref_sysprefs, '>=', 0, |
43 |
cmp_ok( $num_sysprefs, '>=', 1, |
| 41 |
"Found " . ( $#ref_sysprefs + 1 ) . " sysprefs" ); |
44 |
"Found $num_sysprefs sysprefs" ); |
| 42 |
} |
45 |
} |
| 43 |
|
46 |
|
| 44 |
check_db($ref_syspref); |
47 |
check_db($ref_syspref); |
| 45 |
- |
|
|