Bugzilla – Attachment 85268 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.24 KB, created by
Martin Renvoize (ashimema)
on 2019-02-19 12:00:21 UTC
(
hide
)
Description:
Bug 22008: Add tests for new constraints
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-02-19 12:00:21 UTC
Size:
2.24 KB
patch
obsolete
>From 9a674e4d6a5fe239610b7e38352d346f95bc3a76 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 21 Dec 2018 11:59:41 +0000 >Subject: [PATCH] Bug 22008: Add tests for new constraints > >--- > t/db_dependent/Koha/Account/Lines.t | 21 +++++++++++++++++++-- > 1 file changed, 19 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t >index f7f0c16554..284c1b692e 100755 >--- a/t/db_dependent/Koha/Account/Lines.t >+++ b/t/db_dependent/Koha/Account/Lines.t >@@ -273,26 +273,43 @@ 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, item or issue is deleted' => sub { > >- plan tests => 2; >+ plan tests => 4; > > $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, >+ issue_id => $issue->issue_id > accounttype => "F", > amount => 10, > })->store; > >+ $issue->delete; >+ $line = $line->get_from_storage; >+ is( $line->issue_id, undef, "The account line should not be deleted when the related issue is delete"); >+ > $item->delete; > $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