Bugzilla – Attachment 170649 Details for
Bug 37550
bulkmarcimport.pl dies when adding items throws an exception
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37550: Unit test for CheckItemPreSave
Bug-37550-Unit-test-for-CheckItemPreSave.patch (text/plain), 2.00 KB, created by
Phil Ringnalda
on 2024-08-23 15:38:39 UTC
(
hide
)
Description:
Bug 37550: Unit test for CheckItemPreSave
Filename:
MIME Type:
Creator:
Phil Ringnalda
Created:
2024-08-23 15:38:39 UTC
Size:
2.00 KB
patch
obsolete
>From 6058e3227b55f2a96bc4d5b69a9a9ecdd7382959 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 1 Aug 2024 18:00:57 +0000 >Subject: [PATCH] Bug 37550: Unit test for CheckItemPreSave > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> >--- > t/db_dependent/Items.t | 26 ++++++++++++++++++++++++-- > 1 file changed, 24 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index f6451c6f4e..48315d6288 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -20,7 +20,7 @@ use Data::Dumper; > > use MARC::Record; > use C4::Items >- qw( ModItemTransfer SearchItems AddItemFromMarc ModItemFromMarc get_hostitemnumbers_of Item2Marc ModDateLastSeen CartToShelf ); >+ qw( ModItemTransfer SearchItems AddItemFromMarc ModItemFromMarc get_hostitemnumbers_of Item2Marc ModDateLastSeen CartToShelf CheckItemPreSave ); > use C4::Biblio qw( GetMarcFromKohaField AddBiblio ); > use C4::Circulation qw( AddIssue ); > use Koha::BackgroundJobs; >@@ -36,7 +36,7 @@ use Koha::AuthorisedValues; > use t::lib::Mocks; > use t::lib::TestBuilder; > >-use Test::More tests => 13; >+use Test::More tests => 14; > > use Test::Warn; > >@@ -129,6 +129,28 @@ subtest 'General Add, Get and Del tests' => sub { > $schema->storage->txn_rollback; > }; > >+subtest 'CheckItemPreSave tests' => sub { >+ plan tests => 1; >+ >+ $schema->storage->txn_begin; >+ >+ my $builder = t::lib::TestBuilder->new; >+ my $item = Koha::Items->find( { barcode => 'SPAGHETTI' } ); >+ $item = $builder->build_sample_item( { barcode => "SPAGHETTI" } ) unless $item; >+ >+ my $check_item = $item->unblessed; >+ delete $check_item->{itemnumber}; >+ $check_item->{barcode} = " SPAGHETTI"; >+ >+ my %errors = CheckItemPreSave($check_item); >+ is_deeply( >+ \%errors, { duplicate_barcode => " SPAGHETTI" }, >+ "We get a duplicate item error for barcode even if whitespace" >+ ); >+ >+ $schema->storage->txn_rollback; >+}; >+ > subtest 'ModItemTransfer tests' => sub { > plan tests => 8; > >-- >2.44.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 37550
:
169959
|
169960
|
169961
|
170630
|
170648
|
170649
|
170650
|
173868
|
173869
|
173870