5 icondirectories.t - test to ensure that the two directories of icons
6 in the staff and opac interface are identical.
10 Tere are two directories of icons for media types, one for the opac
11 and one for the staff interface. They need to be identical. This
12 ensures that they are.
23 use Test
::More tests
=> 3;
25 my $opac_icon_directory = 'koha-tmpl/opac-tmpl/prog/itemtypeimg';
26 my $staff_icon_directory = 'koha-tmpl/intranet-tmpl/prog/img/itemtypeimg';
28 ok
( -d
$opac_icon_directory, "opac_icon_directory: $opac_icon_directory exists" );
29 ok
( -d
$staff_icon_directory, "staff_icon_directory: $staff_icon_directory exists" );
31 my $opac_icons; # hashref of filenames to sizes
33 my $file = $File::Find
::name
;
34 $file =~ s/^$opac_icon_directory//;
35 $opac_icons->{ $file } = -s
$_;
38 find
( \
&opac_wanted
, $opac_icon_directory );
40 my $staff_icons; # hashref of filenames to sizes
42 my $file = $File::Find
::name
;
43 $file =~ s/^$staff_icon_directory//;
44 $staff_icons->{ $file } = -s
$_;
46 find
( \
&staff_wanted
, $staff_icon_directory );
48 is_deeply
( $opac_icons, $staff_icons, "staff and OPAC icon directories have same contents" )
49 or diag
( Data
::Dumper
->Dump( [ $opac_icons ], [ 'opac_icons' ] ) );