Bugzilla – Attachment 128682 Details for
Bug 29553
Holds: Can't call method "notforloan" on an undefined value when placing a hold
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29553: Regression tests
Bug-29553-Regression-tests.patch (text/plain), 1.87 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-12-17 15:54:43 UTC
(
hide
)
Description:
Bug 29553: Regression tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-12-17 15:54:43 UTC
Size:
1.87 KB
patch
obsolete
>From 43edddf8c80557c8947147a39becc3de3a5f1722 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 17 Dec 2021 12:52:17 -0300 >Subject: [PATCH] Bug 29553: Regression tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/Reserves.t | 39 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 9b4122dbd4..a0e9df0016 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 68; >+use Test::More tests => 69; > use Test::MockModule; > use Test::Warn; > >@@ -1362,3 +1362,40 @@ sub place_item_hold { > > # we reached the finish > $schema->storage->txn_rollback(); >+ >+subtest 'IsAvailableForItemLevelRequest() tests' => sub { >+ >+ plan tests => 2; >+ >+ $schema->storage->txn_begin; >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ >+ my $item_type = undef; >+ >+ my $item_mock = Test::MockModule->new('Koha::Item'); >+ $item_mock->mock( 'effective_itemtype', sub { return $item_type; } ); >+ >+ my $item = $builder->build_sample_item; >+ >+ ok( >+ !C4::Reserves::IsAvailableForItemLevelRequest( $item, $patron ), >+ "Item not available for item-level hold because no effective item type" >+ ); >+ >+ # Weird use case to highlight issue >+ $item_type = '0'; >+ Koha::ItemTypes->search( { itemtype => $item_type } )->delete; >+ my $itemtype = $builder->build_object( >+ { >+ class => 'Koha::ItemTypes', >+ value => { itemtype => $item_type, notloan => 0 } >+ } >+ ); >+ ok( >+ C4::Reserves::IsAvailableForItemLevelRequest( $item, $patron ), >+ "Item not available for item-level hold because no effective item type" >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.32.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 29553
:
127925
|
128122
|
128681
| 128682 |
128683