Bugzilla – Attachment 142719 Details for
Bug 32019
Add option to mark items returned in batch modification
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32019: Unit tests
Bug-32019-Unit-tests.patch (text/plain), 1.82 KB, created by
Nick Clemens (kidclamp)
on 2022-10-27 16:21:07 UTC
(
hide
)
Description:
Bug 32019: Unit tests
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-10-27 16:21:07 UTC
Size:
1.82 KB
patch
obsolete
>From ecd1cfc654cec93bd7c3082230ed76282eff6458 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 27 Oct 2022 16:13:05 +0000 >Subject: [PATCH] Bug 32019: Unit tests > >--- > t/db_dependent/Koha/Items/BatchUpdate.t | 29 ++++++++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Items/BatchUpdate.t b/t/db_dependent/Koha/Items/BatchUpdate.t >index 2a3811e141..af6e5b6c43 100755 >--- a/t/db_dependent/Koha/Items/BatchUpdate.t >+++ b/t/db_dependent/Koha/Items/BatchUpdate.t >@@ -16,7 +16,8 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests=> 7; >+use Test::More tests=> 8; >+use Test::Warn; > use utf8; > > use Koha::Database; >@@ -27,6 +28,7 @@ use Koha::Item::Attributes; > use Koha::MarcSubfieldStructures; > > use t::lib::TestBuilder; >+use t::lib::Mocks; > > my $schema = Koha::Database->new->schema; > $schema->storage->txn_begin; >@@ -252,6 +254,31 @@ subtest 'encoding' => sub { > is( $item->as_marc_field->subfield('é'), 'new note é', ); > }; > >+subtest 'mark_items_returned' => sub { >+ plan tests => 2; >+ >+ my $circ = Test::MockModule->new( 'C4::Circulation' ); >+ $circ->mock( 'MarkIssueReturned', sub { >+ warn "MarkIssueReturned"; >+ }); >+ >+ my $issue = $builder->build_object({class => 'Koha::Checkouts'}); >+ my $items = Koha::Items->search({ itemnumber => $issue->itemnumber }); >+ >+ warning_is >+ { $items->batch_update({new_values => {},mark_items_returned => 1}) } >+ qq{MarkIssueReturned}, >+ "MarkIssueReturned called for item"; >+ >+ $items->reset; >+ >+ warning_is >+ { $items->batch_update({new_values => {},mark_items_returned => 0}) } >+ qq{}, >+ "MarkIssueReturned not called for item"; >+ >+}; >+ > subtest 'report' => sub { > plan tests => 5; > >-- >2.30.2
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 32019
:
142719
|
142720
|
142764
|
142765
|
142766
|
142823
|
142824
|
142825
|
145294
|
145295
|
145296