Bugzilla – Attachment 83220 Details for
Bug 21065
Data in account_offsets and accountlines is deleted with the patron leaving gaps in financial reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21065: Add tests
Bug-21065-Add-tests.patch (text/plain), 1.64 KB, created by
Jonathan Druart
on 2018-12-14 15:53:16 UTC
(
hide
)
Description:
Bug 21065: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-12-14 15:53:16 UTC
Size:
1.64 KB
patch
obsolete
>From 345b1b2367f4f4686a7d4fd28425631bbde51e79 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 14 Dec 2018 12:47:11 -0300 >Subject: [PATCH] Bug 21065: Add tests > >--- > t/db_dependent/Koha/Account/Lines.t | 30 +++++++++++++++++++++++++++++- > 1 file changed, 29 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t >index eb8dfdd1c0..e5bd77d374 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 => 4; >+use Test::More tests => 5; > use Test::Exception; > > use Koha::Account; >@@ -268,3 +268,31 @@ subtest 'apply() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'Keep account info when a patron is deleted' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $item = $builder->build_object({ class => 'Koha::Items' }); >+ my $line = Koha::Account::Line->new( >+ { >+ borrowernumber => $patron->borrowernumber, >+ itemnumber => $item->itemnumber, >+ accounttype => "F", >+ amount => 10, >+ })->store; >+ >+ $item->delete; >+ $line = $line->get_from_storage; >+ is( $line->itemnumber, undef, "The account line should not be deleted when the related item is delete"); >+ >+ $patron->delete; >+ $line = $line->get_from_storage; >+ is( $line->borrowernumber, undef, "The account line should not be deleted when the related patron is delete"); >+ >+ $schema->storage->txn_rollback; >+}; >+ >-- >2.11.0
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 21065
:
83220
|
83221
|
83222
|
83223
|
83224
|
83235
|
83236
|
83237
|
83238
|
83366