Bugzilla – Attachment 86994 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: Fix failing tests
Bug-22008-Fix-failing-tests.patch (text/plain), 3.18 KB, created by
Nick Clemens
on 2019-03-25 19:39:05 UTC
(
hide
)
Description:
Bug 22008: Fix failing tests
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2019-03-25 19:39:05 UTC
Size:
3.18 KB
patch
obsolete
>From e2b444d7beb4def68f99a339d45dce988bac4e46 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 25 Mar 2019 19:38:40 +0000 >Subject: [PATCH] Bug 22008: Fix failing tests > >--- > acqui/ordered.pl | 2 +- > t/db_dependent/Accounts.t | 9 ++++++++- > t/db_dependent/Circulation.t | 4 ++++ > 3 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/acqui/ordered.pl b/acqui/ordered.pl >index 3eb0519c65..d26a977827 100755 >--- a/acqui/ordered.pl >+++ b/acqui/ordered.pl >@@ -99,7 +99,7 @@ while ( my $data = $sth->fetchrow_hashref ) { > $left = $data->{'quantity'}; > } > if ( $left && $left > 0 ) { >- my $subtotal = get_rounded_price( $left * $data->{'ecost_tax_included'} ); >+ my $subtotal = get_rounded_price( $data->{'ecost_tax_included'} ) * $left; > $data->{subtotal} = sprintf( "%.2f", $subtotal ); > $data->{'left'} = $left; > push @ordered, $data; >diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t >index 6af3a3d1c0..8822ea8bec 100644 >--- a/t/db_dependent/Accounts.t >+++ b/t/db_dependent/Accounts.t >@@ -1093,6 +1093,14 @@ subtest "Payment notice tests" => sub { > } > )->store(); > >+ my $manager = $builder->build_object({ class => "Koha::Patrons" }); >+ my $context = new Test::MockModule('C4::Context'); >+ $context->mock( 'userenv', sub { >+ return { >+ number => $manager->borrowernumber, >+ branch => $manager->branchcode, >+ }; >+ }); > my $account = Koha::Account->new({ patron_id => $borrower->id }); > > my $line = Koha::Account::Line->new({ borrowernumber => $borrower->borrowernumber, amountoutstanding => 27 })->store(); >@@ -1102,7 +1110,6 @@ subtest "Payment notice tests" => sub { > $letter->store(); > > t::lib::Mocks::mock_preference('UseEmailReceipts', '0'); >- > my $id = $account->pay( { amount => 1 } ); > is( Koha::Notice::Messages->search()->count(), 0, 'Notice for payment not sent if UseEmailReceipts is disabled' ); > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 134921269a..6c5e6e9566 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -916,6 +916,8 @@ my ( $reused_itemnumber_1, $reused_itemnumber_2 ); > ( $renewokay, $error ) = CanBookBeRenewed($renewing_borrowernumber, $item_7->itemnumber); > is( $renewokay, 0, '(Bug 8236), Cannot renew, one of the items is overdue'); > >+ my $manager = $builder->build_object({ class => "Koha::Patrons" }); >+ t::lib::Mocks::mock_userenv({ patron => $manager,branchcode => $manager->branchcode }); > t::lib::Mocks::mock_preference('WhenLostChargeReplacementFee','1'); > $checkout = Koha::Checkouts->find( { itemnumber => $item_3->itemnumber } ); > LostItem( $item_3->itemnumber, 'test', 0 ); >@@ -2004,6 +2006,8 @@ subtest '_FixAccountForLostAndReturned' => sub { > plan tests => 10; > > my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my manager = $builder->build_object({ class => "Koha::Patrons" }); >+ t::lib::Mocks::mock_userenv({ patron => $manager,branchcode => $manager->branchcode }); > > my $item = $builder->build_sample_item( > { >-- >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 22008
:
83278
|
83280
|
83460
|
83461
|
83462
|
85267
|
85268
|
85613
|
85614
|
85767
|
85768
|
86162
|
86163
|
86164
|
86659
|
86660
|
86661
|
86994
|
86995
|
87066
|
87072