Bugzilla – Attachment 169960 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), 1.95 KB, created by
Nick Clemens (kidclamp)
on 2024-08-01 18:08:27 UTC
(
hide
)
Description:
Bug 37550: Unit test for CheckItemPreSave
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-08-01 18:08:27 UTC
Size:
1.95 KB
patch
obsolete
>From 8b2fd003f707e9d01ff2af567ef806575a804ca7 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 > >--- > 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 f6451c6f4e5..48315d6288b 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.39.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 37550
:
169959
|
169960
|
169961
|
170630
|
170648
|
170649
|
170650
|
173868
|
173869
|
173870