Bug 6316 - MARC21 files (split part)
[koha.git] / xt / syspref.t
index ab07e37..1b7c438 100755 (executable)
@@ -24,12 +24,14 @@ 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_syspref_file = "en/mandatory/sysprefs.sql";
 my @trans_syspref_files = qw(
+    de-DE/mandatory/sysprefs.sql
+    it-IT/necessari/sysprefs.sql
     fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
-    uk-UA/mandatory/system_preferences_optimal.sql
-    ru-RU/mandatory/system_preferences_optimal.sql
+    uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
+    ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
     pl-PL/mandatory/sysprefs.sql
 );
 
@@ -64,6 +66,8 @@ sub get_syspref_from_file {
         /\(\'([\w\-:]+)\'/;
         my $variable = $1;
         next unless $variable;
+        # lowercase syspref - at present, systempreference lookup is not case-sensitive
+        $variable = lc $variable;
         $syspref{$variable} = 1;
     }
     return \%syspref;
@@ -86,7 +90,7 @@ sub compare_syspref {
        push @to_add_sysprefs, $_ if ! $trans_syspref->{$_};
     }
     if ( $#to_add_sysprefs >= 0 ) {
-        fail( 'No syspref to add') or diag( "Sysprefs to add in $trans_file: " . join(', ', @to_add_sysprefs ) );
+       fail("Sysprefs to add in $trans_file: " . join(', ', @to_add_sysprefs ) );
     }
     else {
         pass( 'No syspref to add' );
@@ -97,7 +101,7 @@ sub compare_syspref {
        push @to_delete_sysprefs, $_ if ! $ref_syspref->{$_};
     }
     if ( $#to_delete_sysprefs >= 0 ) {
-        fail( 'No syspref to delete' );
+        fail( 'sysprefs to delete' );
         diag( "Sysprefs to delete in $trans_file: " . join(', ', @to_delete_sysprefs ) );
         diag( 'Warning: Some of those sysprefs may rather have to be added to English sysprefs' );
     }