Bugzilla – Attachment 172306 Details for
Bug 17976
TT syntax for notices - Add an equivalence for items.fine
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17976: Unit tests
Bug-17976-Unit-tests.patch (text/plain), 2.82 KB, created by
Emily Lamancusa (emlam)
on 2024-10-02 13:58:25 UTC
(
hide
)
Description:
Bug 17976: Unit tests
Filename:
MIME Type:
Creator:
Emily Lamancusa (emlam)
Created:
2024-10-02 13:58:25 UTC
Size:
2.82 KB
patch
obsolete
>From 7cdf9741818e9bb132b3235e2278554d09ae2ada Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 1 Oct 2024 16:45:07 +0100 >Subject: [PATCH] Bug 17976: Unit tests > >Add unit tests for the newly introduced overdue fines relation accessor. > >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >--- > t/db_dependent/Koha/Checkout.t | 57 +++++++++++++++++++++++++++++++++- > 1 file changed, 56 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Checkout.t b/t/db_dependent/Koha/Checkout.t >index 7459cbcbf8..5effd76a69 100755 >--- a/t/db_dependent/Koha/Checkout.t >+++ b/t/db_dependent/Koha/Checkout.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 2; >+use Test::More tests => 3; > use t::lib::TestBuilder; > > use Koha::Database; >@@ -27,6 +27,61 @@ use Koha::Database; > my $builder = t::lib::TestBuilder->new; > my $schema = Koha::Database->new->schema; > >+subtest 'overdue_fines' => sub { >+ plan tests => 4; >+ >+ my $checkout = $builder->build_object( >+ { >+ class => 'Koha::Checkouts', >+ } >+ ); >+ >+ my $overdueline = Koha::Account::Line->new( >+ { >+ issue_id => $checkout->id, >+ borrowernumber => $checkout->borrowernumber, >+ itemnumber => $checkout->itemnumber, >+ branchcode => $checkout->branchcode, >+ date => \'NOW()', >+ debit_type_code => 'OVERDUE', >+ status => 'UNRETURNED', >+ interface => 'cli', >+ amount => '1', >+ amountoutstanding => '1', >+ } >+ )->store(); >+ >+ my $accountline = Koha::Account::Line->new( >+ { >+ issue_id => $checkout->id, >+ borrowernumber => $checkout->borrowernumber, >+ itemnumber => $checkout->itemnumber, >+ branchcode => $checkout->branchcode, >+ date => \'NOW()', >+ debit_type_code => 'LOST', >+ status => '', >+ interface => 'cli', >+ amount => '1', >+ amountoutstanding => '1', >+ } >+ )->store(); >+ >+ my $overdue_fines = $checkout->overdue_fines; >+ is( ref($overdue_fines), 'Koha::Account::Lines', >+ 'Koha::Checkout->overdue_fines should return a Koha::Account::Lines' ); >+ is( $overdue_fines->count, 1, "Koha::Checkout->overdue_fines returns only overdue fines"); >+ >+ my $overdue = $overdue_fines->next; >+ is( ref($overdue), 'Koha::Account::Line', >+ 'next returns a Koha::Account::Line' ); >+ >+ is( >+ $overdueline->id, >+ $overdue->id, >+ 'Koha::Checkout->overdue_fines should return the correct overdue_fines' >+ ); >+}; >+ > subtest 'library() tests' => sub { > > plan tests => 2; >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17976
:
172277
|
172278
|
172283
|
172304
|
172305
|
172306
|
172328
|
172329
|
172330
|
172331
|
174324