@@ -, +, @@ --- Koha/{Issue.pm => Checkout.pm} | 2 +- Koha/{Issues.pm => Checkouts.pm} | 6 +++--- t/db_dependent/Koha/{Issues.t => Checkouts.t} | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) rename Koha/{Issue.pm => Checkout.pm} (97%) rename Koha/{Issues.pm => Checkouts.pm} (91%) rename t/db_dependent/Koha/{Issues.t => Checkouts.t} (78%) --- a/Koha/Issue.pm +++ a/Koha/Issue.pm @@ -1,4 +1,4 @@ -package Koha::Issue; +package Koha::Checkout; # This file is part of Koha. # --- a/Koha/Issues.pm +++ a/Koha/Issues.pm @@ -1,4 +1,4 @@ -package Koha::Issues; +package Koha::Checkouts; # This file is part of Koha. # @@ -18,7 +18,7 @@ package Koha::Issues; use Modern::Perl; use Koha::Database; -use Koha::Issue; +use Koha::Checkout; use base qw(Koha::Objects); @@ -27,7 +27,7 @@ sub _type { } sub object_class { - return 'Koha::Issue'; + return 'Koha::Checkout'; } 1; --- a/t/db_dependent/Koha/Issues.t +++ a/t/db_dependent/Koha/Issues.t @@ -21,8 +21,8 @@ use Modern::Perl; use Test::More tests => 4; -use Koha::Issue; -use Koha::Issues; +use Koha::Checkout; +use Koha::Checkouts; use Koha::Database; use t::lib::TestBuilder; @@ -34,26 +34,26 @@ my $builder = t::lib::TestBuilder->new; my $patron = $builder->build( { source => 'Borrower' } ); my $item_1 = $builder->build( { source => 'Item' } ); my $item_2 = $builder->build( { source => 'Item' } ); -my $nb_of_issues = Koha::Issues->search->count; -my $new_issue_1 = Koha::Issue->new( +my $nb_of_issues = Koha::Checkouts->search->count; +my $new_issue_1 = Koha::Checkout->new( { borrowernumber => $patron->{borrowernumber}, itemnumber => $item_1->{itemnumber}, } )->store; -my $new_issue_2 = Koha::Issue->new( +my $new_issue_2 = Koha::Checkout->new( { borrowernumber => $patron->{borrowernumber}, itemnumber => $item_2->{itemnumber}, } )->store; like( $new_issue_1->issue_id, qr|^\d+$|, 'Adding a new issue should have set the issue_id' ); -is( Koha::Issues->search->count, $nb_of_issues + 2, 'The 2 issues should have been added' ); +is( Koha::Checkouts->search->count, $nb_of_issues + 2, 'The 2 issues should have been added' ); -my $retrieved_issue_1 = Koha::Issues->find( $new_issue_1->issue_id ); +my $retrieved_issue_1 = Koha::Checkouts->find( $new_issue_1->issue_id ); is( $retrieved_issue_1->itemnumber, $new_issue_1->itemnumber, 'Find a issue by id should return the correct issue' ); $retrieved_issue_1->delete; -is( Koha::Issues->search->count, $nb_of_issues + 1, 'Delete should delete the issue' ); +is( Koha::Checkouts->search->count, $nb_of_issues + 1, 'Delete should delete the issue' ); $schema->storage->txn_rollback; --