Bugzilla – Attachment 85767 Details for
Bug 22008
accountlines.manager_id is missing a foreign key constraint
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22008: Add tests for new constraints
Bug-22008-Add-tests-for-new-constraints.patch (text/plain), 2.06 KB, created by
Martin Renvoize (ashimema)
on 2019-02-27 12:26:31 UTC
(
hide
)
Description:
Bug 22008: Add tests for new constraints
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-02-27 12:26:31 UTC
Size:
2.06 KB
patch
obsolete
>From a4aad60c6bd43a8e33644970eba4efeaee38a1c5 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 27 Feb 2019 12:02:36 +0000 >Subject: [PATCH] Bug 22008: Add tests for new constraints > >--- > t/db_dependent/Koha/Account/Lines.t | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t >index f7f0c16554..31543dc4d5 100755 >--- a/t/db_dependent/Koha/Account/Lines.t >+++ b/t/db_dependent/Koha/Account/Lines.t >@@ -273,17 +273,25 @@ subtest 'apply() tests' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'Keep account info when a patron is deleted' => sub { >+subtest 'Keep account info when related patron, staff or item is deleted' => sub { > >- plan tests => 2; >+ plan tests => 3; > > $schema->storage->txn_begin; > > my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $staff = $builder->build_object( { class => 'Koha::Patrons' } ); > my $item = $builder->build_object({ class => 'Koha::Items' }); >+ my $issue = $builder->build_object( >+ { >+ class => 'Koha::Checkout', >+ value => { itemnumber => $item->itemnumber } >+ } >+ ); > my $line = Koha::Account::Line->new( > { > borrowernumber => $patron->borrowernumber, >+ manager_id => $staff->borrowernumber, > itemnumber => $item->itemnumber, > accounttype => "F", > amount => 10, >@@ -293,6 +301,10 @@ subtest 'Keep account info when a patron is deleted' => sub { > $line = $line->get_from_storage; > is( $line->itemnumber, undef, "The account line should not be deleted when the related item is delete"); > >+ $staff->delete; >+ $line = $line->get_from_storage; >+ is( $line->manager_id, undef, "The account line should not be deleted when the related staff 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"); >-- >2.20.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 22008
:
83278
|
83280
|
83460
|
83461
|
83462
|
85267
|
85268
|
85613
|
85614
|
85767
|
85768
|
86162
|
86163
|
86164
|
86659
|
86660
|
86661
|
86994
|
86995
|
87066
|
87072