Bugzilla – Attachment 148666 Details for
Bug 33021
Show an alert when adding an item on hold to an item bundle
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33021: (QA follow-up) Add unit test
Bug-33021-QA-follow-up-Add-unit-test.patch (text/plain), 2.35 KB, created by
Kyle M Hall (khall)
on 2023-03-24 14:44:23 UTC
(
hide
)
Description:
Bug 33021: (QA follow-up) Add unit test
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-03-24 14:44:23 UTC
Size:
2.35 KB
patch
obsolete
>From 825647952d31a6646eeefc067498c2b4a98c0ecd Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 24 Mar 2023 10:42:08 -0400 >Subject: [PATCH] Bug 33021: (QA follow-up) Add unit test > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Koha/Item.t | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 7ac3e79c729..d4fbac7f8f3 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -213,7 +213,7 @@ subtest 'bundle_host tests' => sub { > }; > > subtest 'add_to_bundle tests' => sub { >- plan tests => 10; >+ plan tests => 11; > > $schema->storage->txn_begin; > >@@ -227,11 +227,26 @@ subtest 'add_to_bundle tests' => sub { > my $host_item = $builder->build_sample_item(); > my $bundle_item1 = $builder->build_sample_item(); > my $bundle_item2 = $builder->build_sample_item(); >+ my $bundle_item3 = $builder->build_sample_item(); >+ >+ my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); > > throws_ok { $host_item->add_to_bundle($host_item) } > 'Koha::Exceptions::Item::Bundle::IsBundle', > 'Exception thrown if you try to add the item to itself'; > >+ my $reserve_id = C4::Reserves::AddReserve( >+ { >+ branchcode => $library->branchcode, >+ borrowernumber => $patron->borrowernumber, >+ biblionumber => $bundle_item3->biblionumber, >+ itemnumber => $bundle_item3->itemnumber, >+ } >+ ); >+ throws_ok { $host_item->add_to_bundle($bundle_item3) } >+ 'Koha::Exceptions::Item::Bundle::ItemHasHolds', >+ 'Exception thrown if you try to add an item with holds to a bundle'; >+ > ok($host_item->add_to_bundle($bundle_item1), 'bundle_item1 added to bundle'); > is($bundle_item1->notforloan, 1, 'add_to_bundle sets notforloan to BundleNotLoanValue'); > >@@ -247,7 +262,6 @@ subtest 'add_to_bundle tests' => sub { > 'Koha::Exceptions::Item::Bundle::IsBundle', > 'Exception thrown if you try to add a bundle host to a bundle item'; > >- my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); > C4::Circulation::AddIssue( $patron->unblessed, $bundle_item2->barcode ); > throws_ok { $host_item->add_to_bundle($bundle_item2) } > 'Koha::Exceptions::Item::Bundle::ItemIsCheckedOut', >-- >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 33021
:
147019
|
147160
|
148665
| 148666