Bugzilla – Attachment 130657 Details for
Bug 26704
Koha::Item store triggers should utilise Koha::Object::Messages for message passing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26704: (follow-up) Fix t/db_dependent/Koha/Items.t
Bug-26704-follow-up-Fix-tdbdependentKohaItemst.patch (text/plain), 5.36 KB, created by
Fridolin Somers
on 2022-02-16 09:09:49 UTC
(
hide
)
Description:
Bug 26704: (follow-up) Fix t/db_dependent/Koha/Items.t
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2022-02-16 09:09:49 UTC
Size:
5.36 KB
patch
obsolete
>From 7bc408fb9af5296cc1d1a5cc8ae662606f7f5342 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 15 Feb 2022 22:06:44 -1000 >Subject: [PATCH] Bug 26704: (follow-up) Fix t/db_dependent/Koha/Items.t > >Note this patch also fixes wrong text in test line 1295 >--- > t/db_dependent/Koha/Items.t | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > >diff --git a/t/db_dependent/Koha/Items.t b/t/db_dependent/Koha/Items.t >index dc258b4510..410dada550 100755 >--- a/t/db_dependent/Koha/Items.t >+++ b/t/db_dependent/Koha/Items.t >@@ -351,7 +351,7 @@ subtest 'store' => sub { > > # Simulate item marked as found > $item->itemlost(0)->store; >- is( $item->{_refunded}, undef, 'No LOST_FOUND account line added' ); >+ is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 0, 'No LOST_FOUND account line added' ); > > $lost_fee_line->discard_changes; # reload from DB > is( $lost_fee_line->amountoutstanding + 0, >@@ -434,7 +434,7 @@ subtest 'store' => sub { > > # Simulate item marked as found > $item->itemlost(0)->store; >- is( $item->{_refunded}, 1, 'Refund triggered' ); >+ is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 1, 'Refund triggered' ); > > my $credit_return = Koha::Account::Lines->search( > { >@@ -524,7 +524,7 @@ subtest 'store' => sub { > > # Simulate item marked as found > $item->itemlost(0)->store; >- is( $item->{_refunded}, 1, 'Refund triggered' ); >+ is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 1, 'Refund triggered' ); > > my $credit_return = Koha::Account::Lines->search( > { >@@ -704,7 +704,7 @@ subtest 'store' => sub { > > # Simulate item marked as found > $item->itemlost(0)->store; >- is( $item->{_refunded}, 1, 'Refund triggered' ); >+ is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 1, 'Refund triggered' ); > > my $credit_return = Koha::Account::Lines->search( > { >@@ -842,7 +842,7 @@ subtest 'store' => sub { > > # Simulate item marked as found > $item->itemlost(0)->store; >- is( $item->{_refunded}, 1, 'Refund triggered' ); >+ is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 1, 'Refund triggered' ); > > my $credit_return = Koha::Account::Lines->search( > { >@@ -917,7 +917,7 @@ subtest 'store' => sub { > > # Simulate item marked as found > $item->itemlost(0)->store; >- is( $item->{_refunded}, undef, 'No refund triggered' ); >+ is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 0, 'No refund triggered' ); > > }; > >@@ -1009,8 +1009,8 @@ subtest 'store' => sub { > > # Simulate item marked as found > $item->itemlost(0)->store; >- is( $item->{_refunded}, 1, 'Refund triggered' ); >- is( $item->{_restored}, undef, 'Restore not triggered when there is no overdue fine found' ); >+ is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 1, 'Refund triggered' ); >+ is( scalar ( grep { $_->message eq 'lost_restored' } @{$item->object_messages} ), 0, 'Restore not triggered when there is no overdue fine found' ); > }; > > subtest 'restore fine | unforgiven overdue' => sub { >@@ -1116,8 +1116,8 @@ subtest 'store' => sub { > > # Simulate item marked as found > $item->itemlost(0)->store; >- is( $item->{_refunded}, 1, 'Refund triggered' ); >- is( $item->{_restored}, undef, 'Restore not triggered when overdue was not forgiven' ); >+ is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 1, 'Refund triggered' ); >+ is( scalar ( grep { $_->message eq 'lost_restored' } @{$item->object_messages} ), 0, 'Restore not triggered when overdue was not forgiven' ); > $overdue->discard_changes; > is( $overdue->status, 'FOUND', > 'Overdue status updated to FOUND' ); >@@ -1240,8 +1240,8 @@ subtest 'store' => sub { > > # Simulate item marked as found > $item->itemlost(0)->store; >- is( $item->{_refunded}, 1, 'Refund triggered' ); >- is( $item->{_restored}, 1, 'Restore triggered when overdue was forgiven' ); >+ is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 1, 'Refund triggered' ); >+ is( scalar ( grep { $_->message eq 'lost_restored' } @{$item->object_messages} ), 1, 'Restore triggered when overdue was forgiven' ); > $overdue->discard_changes; > is( $overdue->status, 'FOUND', 'Overdue status updated to FOUND' ); > is( $overdue->amountoutstanding, $overdue->amount, 'Overdue outstanding has been restored' ); >@@ -1292,7 +1292,7 @@ subtest 'store' => sub { > > # Simluate item marked as found > $item->itemlost(0)->store; >- is( $item->{_refunded}, 1, 'No refund triggered' ); >+ is( scalar ( grep { $_->message eq 'lost_refunded' } @{$item->object_messages} ), 1, 'Refund triggered' ); > > }; > }; >-- >2.35.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 26704
:
118548
|
122004
|
128070
|
128084
|
128085
|
130027
|
130028
|
130484
|
130485
|
130486
|
130657
|
130658