From 05ca02905589092888e2da08283ce76e62b37e27 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Sat, 19 Jun 2010 15:48:28 -0400 Subject: [PATCH] fixed problems in xt/permissions.t test case * now looks for permissions SQL files in the current source tree, not in intranetdir; tests in xt/ and t/ are meant to be run without requiring a full Koha installation * added path to German * fixed paths to permissions SQL for Russian and Ukrainian * handles case where SQL script contains more than just inserts into to permissions Signed-off-by: Galen Charlton --- xt/permissions.t | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xt/permissions.t b/xt/permissions.t index 7e615242b2..377f451517 100755 --- a/xt/permissions.t +++ b/xt/permissions.t @@ -24,12 +24,13 @@ use Test::More qw(no_plan); use C4::Context; -my $root_dir = C4::Context->config( 'intranetdir' ) . '/installer/data/mysql'; +my $root_dir = 'installer/data/mysql'; my $base_perms_file = "en/mandatory/userpermissions.sql"; my @trans_perms_files = qw( + de-DE/mandatory/userpermissions.sql fr-FR/1-Obligatoire/userpermissions.sql - uk-UA/mandatory/userpermissions.sql - ru-RU/mandatory/userpermissions.sql + uk-UA/mandatory/permissions_and_user_flags.sql + ru-RU/mandatory/permissions_and_user_flags.sql pl-PL/mandatory/userpermissions.sql ); @@ -58,8 +59,11 @@ foreach my $file_name ( @trans_perms_files ) { sub get_perms_from_file { my $fh = shift; my %perm; + my $found_insert = 0; while ( <$fh> ) { next if /^--/; # Comment line + $found_insert = 1 if /insert\s+into/i and /permissions/i; + next unless $found_insert; #/VALUES.*\(\'([\w\-:]+)\'/; /,\s*\'(.*?)\'/; my $variable = $1;