bug 2088: test suite refactoring to deal with t/override_context_prefs.pm
Some minor changes to get the test suite working a bit better: I removed a superfluous method from t/lib/KohaTest.pm. I made each barcode for the items added in KohaTest.pm unique so that they would actually get inserted. Then, I removed t/override_context_prefs.pm. If you need that functionality, you're a database dependent test and should be a module in t/lib. So, I deleted all of the trivial .t tests that just 'use'd their modules and had no other tests and replaced them with lib/KohaTest/*pm modules that do a little bit more checking on those modules. I removed the references to override_context_prefs.pm in all of the other .t modules. They all pass now with no override_context_prefs.pm module. The database_depenedent.pl test script still does not pass entirely. There's a problem with the zebra index not being reset each time that the tables are truncated. I'll get to that. no functional or documentation changes here. Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
df0fccdcbf
commit
db755a4307
17
t/Accounts.t
17
t/Accounts.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Accounts');
|
||||
}
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::AuthoritiesMarc');
|
||||
}
|
||||
|
||||
17
t/Biblio.t
17
t/Biblio.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Biblio');
|
||||
}
|
||||
|
||||
17
t/Breeding.t
17
t/Breeding.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Breeding');
|
||||
}
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Circulation');
|
||||
}
|
||||
|
||||
1
t/Date.t
1
t/Date.t
|
|
@ -9,7 +9,6 @@ use Test::More tests => 4;
|
|||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Date');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use Test::More tests => 126;
|
|||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Dates', qw(format_date format_date_in_iso));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use Test::More tests => 28;
|
|||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
# use override_context_prefs;
|
||||
use_ok('C4::Items');
|
||||
}
|
||||
|
||||
|
|
|
|||
17
t/Letters.t
17
t/Letters.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Letters');
|
||||
}
|
||||
|
||||
17
t/Log.t
17
t/Log.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Log');
|
||||
}
|
||||
|
||||
17
t/Members.t
17
t/Members.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Members');
|
||||
}
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::NewsChannels');
|
||||
}
|
||||
|
||||
17
t/Overdues.t
17
t/Overdues.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Overdues');
|
||||
}
|
||||
|
||||
17
t/Print.t
17
t/Print.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Print');
|
||||
}
|
||||
|
||||
17
t/Reserves.t
17
t/Reserves.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use_ok('C4::Reserves');
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
}
|
||||
|
||||
17
t/Search.t
17
t/Search.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Search');
|
||||
}
|
||||
|
||||
17
t/Serials.t
17
t/Serials.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Serials');
|
||||
}
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Suggestions');
|
||||
}
|
||||
|
||||
17
t/Z3950.t
17
t/Z3950.t
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# This Koha test module is a stub!
|
||||
# Add more tests here!!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 1;
|
||||
|
||||
BEGIN {
|
||||
use FindBin;
|
||||
use lib $FindBin::Bin;
|
||||
use override_context_prefs;
|
||||
use_ok('C4::Z3950');
|
||||
}
|
||||
|
||||
|
|
@ -193,30 +193,6 @@ sub startup_15_truncate_tables : Test( startup => 1 ) {
|
|||
or $failed_to_truncate = 1;
|
||||
}
|
||||
is( $failed_to_truncate, 0, 'truncated tables' );
|
||||
|
||||
}
|
||||
|
||||
=head startup_18_set_insecure
|
||||
|
||||
=cut
|
||||
|
||||
# sub startup_18_set_insecure : Test( startup => 4 ) {
|
||||
sub startup_18_set_insecure {
|
||||
my $self = shift;
|
||||
|
||||
ok( C4::Context->dbh, 'got a database handle' );
|
||||
isa_ok( C4::Context->dbh, 'DBI::db' );
|
||||
my $query = q( UPDATE systempreferences
|
||||
SET value = 1
|
||||
WHERE variable = 'insecure' );
|
||||
my $ok = C4::Context->dbh->do( $query );
|
||||
ok( $ok, 'set context to insecure' );
|
||||
|
||||
my $insecure_from_preference = C4::Context->preference( 'insecure' );
|
||||
is( $insecure_from_preference, 1, 'running in insecure mode' )
|
||||
or diag( Data::Dumper->Dump( [ $insecure_from_preference ], [ 'insecure_from_preference' ] ) );
|
||||
|
||||
return $ok;
|
||||
}
|
||||
|
||||
=head2 startup_20_add_bookseller
|
||||
|
|
@ -404,7 +380,7 @@ sub add_biblios {
|
|||
a => sprintf( 'The Adventures of Huckleberry Finn Test %s', $counter ),
|
||||
c => "Mark Twain ; illustrated by E.W. Kemble." ),
|
||||
MARC::Field->new( '952', '0', '0',
|
||||
p => '12345678' ), # barcode
|
||||
p => '12345678' . $self->random_string() ), # barcode
|
||||
MARC::Field->new( '952', '0', '0',
|
||||
a => 'CPL',
|
||||
b => 'CPL' ),
|
||||
|
|
@ -450,7 +426,7 @@ sub add_biblios {
|
|||
|
||||
}
|
||||
|
||||
=head3 reindex_bibs
|
||||
=head3 reindex_marc
|
||||
|
||||
Do a fast reindexing of all of the bib and authority
|
||||
records and mark all zebraqueue entries done.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package KohaTest::Accounts;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Accounts;
|
||||
sub testing_class { 'C4::Accounts' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( recordpayment
|
||||
makepayment
|
||||
getnextacctno
|
||||
fixaccounts
|
||||
returnlost
|
||||
manualinvoice
|
||||
fixcredit
|
||||
refund
|
||||
getcharges
|
||||
getcredits
|
||||
getrefunds
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package KohaTest::AuthoritiesMarc;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::AuthoritiesMarc;
|
||||
sub testing_class { 'C4::AuthoritiesMarc' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( GetAuthMARCFromKohaField
|
||||
SearchAuthorities
|
||||
CountUsage
|
||||
CountUsageChildren
|
||||
GetAuthTypeCode
|
||||
GetTagsLabels
|
||||
AddAuthority
|
||||
DelAuthority
|
||||
ModAuthority
|
||||
GetAuthorityXML
|
||||
GetAuthority
|
||||
GetAuthType
|
||||
AUTHhtml2marc
|
||||
FindDuplicateAuthority
|
||||
BuildSummary
|
||||
BuildUnimarcHierarchies
|
||||
BuildUnimarcHierarchy
|
||||
GetHeaderAuthority
|
||||
AddAuthorityTrees
|
||||
merge
|
||||
get_auth_type_location
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package KohaTest::Biblio;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Biblio;
|
||||
sub testing_class { 'C4::Biblio' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw(
|
||||
AddBiblio
|
||||
ModBiblio
|
||||
ModBiblioframework
|
||||
DelBiblio
|
||||
LinkBibHeadingsToAuthorities
|
||||
GetBiblioData
|
||||
GetBiblioItemData
|
||||
GetBiblioItemByBiblioNumber
|
||||
GetBiblioFromItemNumber
|
||||
GetBiblio
|
||||
GetBiblioItemInfosOf
|
||||
GetMarcStructure
|
||||
GetUsedMarcStructure
|
||||
GetMarcFromKohaField
|
||||
GetMarcBiblio
|
||||
GetXmlBiblio
|
||||
GetAuthorisedValueDesc
|
||||
GetMarcNotes
|
||||
GetMarcSubjects
|
||||
GetMarcAuthors
|
||||
GetMarcUrls
|
||||
GetMarcSeries
|
||||
GetFrameworkCode
|
||||
GetPublisherNameFromIsbn
|
||||
TransformKohaToMarc
|
||||
TransformKohaToMarcOneField
|
||||
TransformHtmlToXml
|
||||
TransformHtmlToMarc
|
||||
TransformMarcToKoha
|
||||
_get_inverted_marc_field_map
|
||||
_disambiguate
|
||||
get_koha_field_from_marc
|
||||
TransformMarcToKohaOneField
|
||||
PrepareItemrecordDisplay
|
||||
ModZebra
|
||||
GetNoZebraIndexes
|
||||
_DelBiblioNoZebra
|
||||
_AddBiblioNoZebra
|
||||
_find_value
|
||||
_koha_marc_update_bib_ids
|
||||
_koha_marc_update_biblioitem_cn_sort
|
||||
_koha_add_biblio
|
||||
_koha_modify_biblio
|
||||
_koha_modify_biblioitem_nonmarc
|
||||
_koha_add_biblioitem
|
||||
_koha_delete_biblio
|
||||
_koha_delete_biblioitems
|
||||
ModBiblioMarc
|
||||
z3950_extended_services
|
||||
set_service_options
|
||||
get_biblio_authorised_values
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package KohaTest::Breeding;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Breeding;
|
||||
sub testing_class { 'C4::Breeding' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( ImportBreeding
|
||||
BreedingSearch
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package KohaTest::Circulation;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Circulation;
|
||||
sub testing_class { 'C4::Circulation' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( barcodedecode
|
||||
decode
|
||||
transferbook
|
||||
TooMany
|
||||
itemissues
|
||||
CanBookBeIssued
|
||||
AddIssue
|
||||
GetLoanLength
|
||||
GetIssuingRule
|
||||
AddReturn
|
||||
MarkIssueReturned
|
||||
FixOverduesOnReturn
|
||||
FixAccountForLostAndReturned
|
||||
GetItemIssue
|
||||
GetItemIssues
|
||||
GetBiblioIssues
|
||||
CanBookBeRenewed
|
||||
AddRenewal
|
||||
GetRenewCount
|
||||
GetIssuingCharges
|
||||
AddIssuingCharge
|
||||
GetTransfers
|
||||
GetTransfersFromTo
|
||||
DeleteTransfer
|
||||
AnonymiseIssueHistory
|
||||
updateWrongTransfer
|
||||
UpdateHoldingbranch
|
||||
CalcDateDue
|
||||
CheckValidDatedue
|
||||
CheckRepeatableHolidays
|
||||
CheckSpecialHolidays
|
||||
CheckRepeatableSpecialHolidays
|
||||
CheckValidBarcode
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package KohaTest::Dates;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Dates;
|
||||
sub testing_class { 'C4::Dates' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( _prefformat
|
||||
regexp
|
||||
dmy_map
|
||||
_check_date_and_time
|
||||
_chron_to_ymd
|
||||
_chron_to_hms
|
||||
new
|
||||
init
|
||||
output
|
||||
today
|
||||
_recognize_format
|
||||
DHTMLcalendar
|
||||
format
|
||||
visual
|
||||
format_date
|
||||
format_date_in_iso
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package KohaTest::Log;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Log;
|
||||
sub testing_class { 'C4::Log' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( logaction
|
||||
GetLogStatus
|
||||
displaylog
|
||||
GetLogs
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package KohaTest::Members;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Members;
|
||||
sub testing_class { 'C4::Members' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( SearchMember
|
||||
GetMemberDetails
|
||||
patronflags
|
||||
GetMember
|
||||
GetMemberIssuesAndFines
|
||||
ModMember
|
||||
AddMember
|
||||
Check_Userid
|
||||
changepassword
|
||||
fixup_cardnumber
|
||||
GetGuarantees
|
||||
UpdateGuarantees
|
||||
GetPendingIssues
|
||||
GetAllIssues
|
||||
GetMemberAccountRecords
|
||||
GetBorNotifyAcctRecord
|
||||
checkuniquemember
|
||||
checkcardnumber
|
||||
getzipnamecity
|
||||
getidcity
|
||||
GetExpiryDate
|
||||
checkuserpassword
|
||||
GetborCatFromCatType
|
||||
GetBorrowercategory
|
||||
ethnicitycategories
|
||||
fixEthnicity
|
||||
GetAge
|
||||
get_institutions
|
||||
add_member_orgs
|
||||
GetCities
|
||||
GetSortDetails
|
||||
MoveMemberToDeleted
|
||||
DelMember
|
||||
ExtendMemberSubscriptionTo
|
||||
GetRoadTypes
|
||||
GetTitles
|
||||
GetPatronImage
|
||||
PutPatronImage
|
||||
RmPatronImage
|
||||
GetRoadTypeDetails
|
||||
GetBorrowersWhoHaveNotBorrowedSince
|
||||
GetBorrowersWhoHaveNeverBorrowed
|
||||
GetBorrowersWithIssuesHistoryOlderThan
|
||||
GetBorrowersNamesAndLatestIssue
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package KohaTest::NewsChannels;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::NewsChannels;
|
||||
sub testing_class { 'C4::NewsChannels' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( news_channels
|
||||
news_channels_by_category
|
||||
get_new_channel
|
||||
del_channels
|
||||
add_channel
|
||||
update_channel
|
||||
news_channels_categories
|
||||
get_new_channel_category
|
||||
del_channels_categories
|
||||
add_channel_category
|
||||
update_channel_category
|
||||
add_opac_new
|
||||
upd_opac_new
|
||||
del_opac_new
|
||||
get_opac_new
|
||||
get_opac_news
|
||||
GetNewsToDisplay
|
||||
add_opac_electronic
|
||||
upd_opac_electronic
|
||||
del_opac_electronic
|
||||
get_opac_electronic
|
||||
get_opac_electronics
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package KohaTest::Overdues;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Overdues;
|
||||
sub testing_class { 'C4::Overdues' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( Getoverdues
|
||||
checkoverdues
|
||||
CalcFine
|
||||
GetSpecialHolidays
|
||||
GetRepeatableHolidays
|
||||
GetWdayFromItemnumber
|
||||
GetIssuesIteminfo
|
||||
UpdateFine
|
||||
BorType
|
||||
ReplacementCost
|
||||
GetFine
|
||||
GetIssuingRules
|
||||
ReplacementCost2
|
||||
GetNextIdNotify
|
||||
NumberNotifyId
|
||||
AmountNotify
|
||||
UpdateAccountLines
|
||||
GetItems
|
||||
GetOverdueDelays
|
||||
CheckAccountLineLevelInfo
|
||||
GetOverduerules
|
||||
CheckBorrowerDebarred
|
||||
UpdateBorrowerDebarred
|
||||
CheckExistantNotifyid
|
||||
CheckAccountLineItemInfo
|
||||
CheckItemNotify
|
||||
GetOverduesForBranch
|
||||
AddNotifyLine
|
||||
RemoveNotifyLine
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package KohaTest::Print;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Print;
|
||||
sub testing_class { 'C4::Print' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( remoteprint
|
||||
printreserve
|
||||
printslip
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package KohaTest::Reserves;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Reserves;
|
||||
sub testing_class { 'C4::Reserves' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( AddReserve
|
||||
GetReservesFromBiblionumber
|
||||
GetReservesFromItemnumber
|
||||
GetReservesFromBorrowernumber
|
||||
GetReserveCount
|
||||
GetOtherReserves
|
||||
GetReserveFee
|
||||
GetReservesToBranch
|
||||
GetReservesForBranch
|
||||
CheckReserves
|
||||
CancelReserve
|
||||
ModReserve
|
||||
ModReserveFill
|
||||
ModReserveStatus
|
||||
ModReserveAffect
|
||||
ModReserveCancelAll
|
||||
ModReserveMinusPriority
|
||||
GetReserveInfo
|
||||
_FixPriority
|
||||
_Findgroupreserve
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package KohaTest::Serials;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Serials;
|
||||
sub testing_class { 'C4::Serials' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( GetSuppliersWithLateIssues
|
||||
GetLateIssues
|
||||
GetSubscriptionHistoryFromSubscriptionId
|
||||
GetSerialStatusFromSerialId
|
||||
GetSerialInformation
|
||||
AddItem2Serial
|
||||
UpdateClaimdateIssues
|
||||
GetSubscription
|
||||
GetFullSubscription
|
||||
PrepareSerialsData
|
||||
GetSubscriptionsFromBiblionumber
|
||||
GetFullSubscriptionsFromBiblionumber
|
||||
GetSubscriptions
|
||||
GetSerials
|
||||
GetSerials2
|
||||
GetLatestSerials
|
||||
GetDistributedTo
|
||||
GetNextSeq
|
||||
GetSeq
|
||||
GetExpirationDate
|
||||
CountSubscriptionFromBiblionumber
|
||||
ModSubscriptionHistory
|
||||
ModSerialStatus
|
||||
ModSubscription
|
||||
NewSubscription
|
||||
ReNewSubscription
|
||||
NewIssue
|
||||
ItemizeSerials
|
||||
HasSubscriptionExpired
|
||||
SetDistributedto
|
||||
DelSubscription
|
||||
DelIssue
|
||||
GetLateOrMissingIssues
|
||||
removeMissingIssue
|
||||
updateClaim
|
||||
getsupplierbyserialid
|
||||
check_routing
|
||||
addroutingmember
|
||||
reorder_members
|
||||
delroutingmember
|
||||
getroutinglist
|
||||
countissuesfrom
|
||||
abouttoexpire
|
||||
old_newsubscription
|
||||
old_modsubscription
|
||||
old_getserials
|
||||
in_array
|
||||
GetNextDate
|
||||
itemdata
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package KohaTest::Suggestions;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Suggestions;
|
||||
sub testing_class { 'C4::Suggestions' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( SearchSuggestion
|
||||
GetSuggestion
|
||||
GetSuggestionFromBiblionumber
|
||||
GetSuggestionByStatus
|
||||
CountSuggestion
|
||||
NewSuggestion
|
||||
ModStatus
|
||||
ConnectSuggestionAndBiblio
|
||||
DelSuggestion
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package KohaTest::Z3950;
|
||||
use base qw( KohaTest );
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
|
||||
use C4::Z3950;
|
||||
sub testing_class { 'C4::Z3950' };
|
||||
|
||||
|
||||
sub methods : Test( 1 ) {
|
||||
my $self = shift;
|
||||
my @methods = qw( getz3950servers
|
||||
z3950servername
|
||||
addz3950queue
|
||||
checkz3950searchdone
|
||||
);
|
||||
|
||||
can_ok( $self->testing_class, @methods );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
|
||||
# This stub module is used to override
|
||||
# the C4::Context sub preference for the
|
||||
# purpose of the test suite. This allows
|
||||
# non-DB-dependent tests of most modules,
|
||||
# particularly the ones that include C4::Dates.
|
||||
|
||||
use C4::Context;
|
||||
|
||||
package C4::Context;
|
||||
no warnings;
|
||||
sub preference {
|
||||
my $self = shift;
|
||||
my $pref = shift;
|
||||
return 'us' if $pref eq 'dateformat';
|
||||
return 'MARC21' if $pref eq 'marcflavour';
|
||||
return 'Test Library' if $pref eq 'LibraryName';
|
||||
return;
|
||||
}
|
||||
|
||||
1;
|
||||
Loading…
Reference in New Issue