Bugzilla – Attachment 139193 Details for
Bug 31313
Remove GetItemsInfo from opac-detail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31313: Unit tests
Bug-31313-Unit-tests.patch (text/plain), 1.80 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-08-16 13:11:56 UTC
(
hide
)
Description:
Bug 31313: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-08-16 13:11:56 UTC
Size:
1.80 KB
patch
obsolete
>From 6bc85707baf453778b38856f32025aa84f4f2c14 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 16 Aug 2022 10:10:03 -0300 >Subject: [PATCH] Bug 31313: Unit tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Koha/Item.t | 29 ++++++++++++++++++++++++++++- > 1 file changed, 28 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 4ad1604f60..b274f0d688 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -20,7 +20,7 @@ > use Modern::Perl; > use utf8; > >-use Test::More tests => 25; >+use Test::More tests => 26; > use Test::Exception; > use Test::MockModule; > >@@ -32,6 +32,7 @@ use Koha::Items; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Old::Items; >+use Koha::Recalls; > > use List::MoreUtils qw(all); > >@@ -1722,3 +1723,29 @@ subtest 'item_group() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'has_pending_recall() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $library = $builder->build_object({ class => 'Koha::Libraries' }); >+ my $item = $builder->build_sample_item; >+ my $patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ >+ t::lib::Mocks::mock_userenv({ branchcode => $library->branchcode }); >+ t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); >+ >+ C4::Circulation::AddIssue( $patron->unblessed, $item->barcode ); >+ >+ my ($recall) = Koha::Recalls->add_recall({ biblio => $item->biblio, item => $item, patron => $patron }); >+ >+ ok( !$item->has_pending_recall, 'The item has no pending recalls' ); >+ >+ $recall->status('waiting')->store; >+ >+ ok( $item->has_pending_recall, 'The item has a pending recall' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.34.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 31313
:
138821
|
138822
|
138847
|
138848
|
139119
|
139120
|
139121
|
139122
| 139193 |
139239
|
139693
|
139694
|
139695
|
139761
|
139762
|
139763