Bugzilla – Attachment 90230 Details for
Bug 19919
Writing off a Lost Item Fee marks as "Paid for by patron"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19919: Unit Tests
Bug-19919-Unit-Tests.patch (text/plain), 2.08 KB, created by
Kyle M Hall (khall)
on 2019-05-31 11:11:22 UTC
(
hide
)
Description:
Bug 19919: Unit Tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-05-31 11:11:22 UTC
Size:
2.08 KB
patch
obsolete
>From 739aba61a27ea953b69d44123097a7bb7068cea1 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 16 May 2019 08:49:22 +0100 >Subject: [PATCH] Bug 19919: Unit Tests > >This patch adds unit tests for the addition of a patron accessor to the >Koha::Account::Line object. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Koha/Account/Lines.t | 31 ++++++++++++++++++++++++++++- > 1 file changed, 30 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t >index 3856f6ef14..9b8e4fa724 100755 >--- a/t/db_dependent/Koha/Account/Lines.t >+++ b/t/db_dependent/Koha/Account/Lines.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 8; >+use Test::More tests => 9; > use Test::Exception; > > use C4::Circulation qw/AddIssue AddReturn/; >@@ -34,6 +34,35 @@ use t::lib::TestBuilder; > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; > >+subtest 'patron() tests' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ my $library = $builder->build( { source => 'Branch' } ); >+ my $patron = $builder->build( { source => 'Borrower' } ); >+ >+ my $line = Koha::Account::Line->new( >+ { >+ borrowernumber => $patron->{borrowernumber}, >+ accounttype => "OVERDUE", >+ status => "RETURNED", >+ amount => 10, >+ interface => 'commandline', >+ })->store; >+ >+ my $account_line_patron = $line->patron; >+ is( ref( $account_line_patron ), 'Koha::Patron', 'Koha::Account::Line->patron should return a Koha::Patron' ); >+ is( $line->borrowernumber, $account_line_patron->borrowernumber, 'Koha::Account::Line->patron should return the correct borrower' ); >+ >+ $line->borrowernumber(undef)->store; >+ is( $line->patron, undef, 'Koha::Account::Line->patron should return undef if no patron linked' ); >+ >+ $schema->storage->txn_rollback; >+}; >+ >+ > subtest 'item() tests' => sub { > > plan tests => 3; >-- >2.20.1 (Apple Git-117)
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 19919
:
70293
|
89320
|
89356
|
89459
|
89472
|
89794
|
89814
|
89815
|
89816
|
89817
|
90228
|
90229
| 90230