Browse Source
I changed getitemtypeimagedir to set a default on its argument so that it would not complain if not passed 'opac'. I improved the documentation on the method. I edited the t/icondirecotries.t test script to explicitly pass an argument to both getitemtypeimagedir calls. - and I adjusted one line of whitespace to make similar things look similar I added a test module for C4::Koha I added a test module for C4::Koha::getitemtypeimagedir. Signed-off-by: Joshua Ferraro <jmf@liblime.com>3.0.x
Andrew Moore
16 years ago
committed by
Joshua Ferraro
4 changed files with 98 additions and 2 deletions
@ -0,0 +1,51 @@ |
|||
package KohaTest::Koha; |
|||
use base qw( KohaTest ); |
|||
|
|||
use strict; |
|||
use warnings; |
|||
|
|||
use Test::More; |
|||
|
|||
use C4::Koha; |
|||
sub testing_class { 'C4::Koha' } |
|||
|
|||
sub methods : Test( 1 ) { |
|||
my $self = shift; |
|||
my @methods = qw( slashifyDate |
|||
DisplayISBN |
|||
subfield_is_koha_internal_p |
|||
GetItemTypes |
|||
get_itemtypeinfos_of |
|||
GetCcodes |
|||
getauthtypes |
|||
getauthtype |
|||
getframeworks |
|||
getframeworkinfo |
|||
getitemtypeinfo |
|||
getitemtypeimagesrcfromurl |
|||
getitemtypeimagedir |
|||
getitemtypeimagesrc |
|||
_getImagesFromDirectory |
|||
_getSubdirectoryNames |
|||
getImageSets |
|||
GetPrinters |
|||
GetPrinter |
|||
getnbpages |
|||
getallthemes |
|||
getFacets |
|||
get_infos_of |
|||
get_notforloan_label_of |
|||
displayServers |
|||
displaySecondaryServers |
|||
GetAuthValCode |
|||
GetAuthorisedValues |
|||
GetAuthorisedValueCategories |
|||
GetKohaAuthorisedValues |
|||
GetManagedTagSubfields |
|||
display_marc_indicators |
|||
); |
|||
|
|||
can_ok( $self->testing_class, @methods ); |
|||
} |
|||
|
|||
1; |
@ -0,0 +1,27 @@ |
|||
package KohaTest::Koha::getitemtypeimagedir; |
|||
use base qw( KohaTest::Koha ); |
|||
|
|||
use strict; |
|||
use warnings; |
|||
|
|||
use Test::More; |
|||
|
|||
use C4::Koha; |
|||
|
|||
sub check_default : Test( 5 ) { |
|||
my $self = shift; |
|||
|
|||
my $opac_directory = C4::Koha::getitemtypeimagedir('opac'); |
|||
my $default_directory = C4::Koha::getitemtypeimagedir('opac'); |
|||
my $intranet_directory = C4::Koha::getitemtypeimagedir('intranet'); |
|||
|
|||
ok( $opac_directory, 'the opac directory is defined' ); |
|||
ok( $default_directory, 'the default directory is defined' ); |
|||
ok( $intranet_directory, 'the intranet directory is defined' ); |
|||
|
|||
is( $opac_directory, $default_directory, 'the opac directory is returned as the default' ); |
|||
isnt( $intranet_directory, $default_directory, 'the intranet directory is not the same as the default' ); |
|||
|
|||
} |
|||
|
|||
1; |
Loading…
Reference in new issue